make parent in unity code example
Example 1: set parent of gameobject unity
child.transform.SetParent(newParent);
Example 2: parent unity
public gameobject player
public gameobject Newparent
player.transform.parent = newParent.transform;
child.transform.SetParent(newParent);
public gameobject player
public gameobject Newparent
player.transform.parent = newParent.transform;