Already have parent

Godot Version

Godot 4.2.2

Question

Hello,
I have error about: Can’t add child ‘Player’ to ‘YellowVanCar’, already has a parent ‘Game’.
Can anyone help me?

2

replace “add_child” with “reparent”. Your node already has a parent so you have to reparent it

2 Likes

You might want to add child if it doesnt have a parent first as well, so add_child when its an orphan and then reparent when it has a parent already

1 Like