Bug in your code. You probably want this:
void Start () {
GameObject newobj = new GameObject("Testing");
newobj.transform.parent = transform; // this transform, not the parent
GameObject.Destroy(gameObject, 2);
}
↧