Cant delete clone from hierachy

Hi guys,

If I do a destroy
Destroy(gameObject, 5);

the object gets destroyed in the game, but its still in the hierachy.
How can i destroy it in there?

What does it mean for something to be in the hierarchy but not in the game?

“What does it mean for something to be in the hierarchy but not in the game?” - Hi Kurt!!!
The ball is destroyed in the game, but PlayerBall(Clone) is still in the hierarchy and i dont want the player to be able to launch another till the original is destroyed.

I think i know whats wrong, im destroying the object the script is attached to, but thats not the entire object. Need to Destroy its parent.

Yip, this fixed it:

Destroy(transform.parent.gameObject, 5);

1 Like