move game object refrence to parent code example Example: unity change parent in script player.transform.parent = newParent.transform;