how to set the parent of an object in Unity C# code example
Example 1: unity reference parent gameobject
transform.parent.gameObject //Use this to reference the parent of the gameobject
Example 2: parent unity
public gameobject player
public gameobject Newparent
player.transform.parent = newParent.transform;