set parent of new gameobject instantly code example
Example 1: how to reference the parent of a gameobject
transform.parent.gameObject
Example 2: set parent of gameobject unity
child.transform.SetParent(newParent);
transform.parent.gameObject
child.transform.SetParent(newParent);