How do I turn off the parent relationship between to objects to false?

So I have an object (cube) to be a child of my player (Player). I have used the following script:

public void SetParent(Transform Player)
{
player.transform.SetParent(Player);

}

This script worked but now is there any other script to delete the parent/child relationship. I think I would have to turn "player.transform.SetParent(Player)) into a variable and then set it to false but I am not sure. Thank you in advance.

Hi,

Your SetParent function should do the trick aswell, try to call SetParent(null); !
(And if it doesn’t work, use directly transform.parent = null; … or set an other gameobject as new parent, like a root game object that holds all your scripts if you have one :slight_smile: