How resources-consuming are disabled things? How much drain puts enable/disable components/GOs on the system?

I asked this question before, but since I had a practical issue mixed in, I only got a solution for this particular problem but not a general answer. But I’m still interested and this question reminded me to go back to my initial inquiry… the >1.6k hits show, that I’m probably not the only one curious…

How much resources are consumed by disabled GameObjects?

How much resources are consumed by disabled Components?

How much strain does enable/disable of GameObjects put on the system?

How much strain does enable/disable of Components put on the system?

Greetz, Ky.

I don’t have access to the Unity source code on enabling/disabling objects so I am not a true expert on the subject, but this is my experience from working with Unity:

  • Almost no CPU resources are spent on inactive GameObjects.
  • Almost no CPU resources are spent on disabled components.
  • Very minimal amount of effort is required by the cpu to activate and deactivate GameObjects.
  • Very minimal amount of effort is required by the cpu to enable and disable Components.

The only overhead a disabled Component or inactive GameObject has is RAM usage, which is not a problem on most modern machines. Besides, it was already using that amount of RAM when it was enabled anyways.

The reason for this is because a script will only use CPU time when a function is called or a value is changed. Disabling a script makes it so that Update and similar functions are not called. No functions are executed, therefore no CPU time is used.

An inactive GameObject works the same way: it only uses CPU time when a value is changed (such as it’s transform position), a function on a script attached to it is called, physics and collisions need to be checked, or it needs to be rendered. None of these things happen when the GameObject is inactive.

SilverTabby’s answer is only partially true. Disabled gameobjects cause a massive amount of CPU time if the parent of the transform is moved as unity still seems to need to calculate each transforms position in space regardless of whether it is active or not.