What happens when a gameobject is disabled

i want to understand what exactly happens when you disactivate a gameobject, does all of its components get disabled or does it get removed from the scene but keep a reference for its transform

It only gets deactivated it doesn’t get removed. Why would you even think that? What made you say that?

Plus all the children tree of the gameobject will be disabled.

Try it.

If you look in the editor you can see that it still exists, but everything under it is deactivated.

It gets disabled, and it (along with its children and components will stop receiving notificatiosn for Update(), LateUpdate(), FixedUpdate() and the like. It does not get removed.

1 Like