how to make a gameobject parent of other in unity using script code example
Example 1: unity reference parent gameobject
transform.parent.gameObject //Use this to reference the parent of the gameobject
Example 2: set parent of gameobject unity
child.transform.SetParent(newParent);