weijia_yu
weijia_yu

Reputation: 1015

Will Disabled and invisible Gameobject take up performance?

If I placed a gameobject with complicated model and texture and disable its mesh renderer, will it still consume CPU and GPU resources? Will it only consume memory?

Upvotes: 2

Views: 3509

Answers (1)

Arman Papikyan
Arman Papikyan

Reputation: 101

If they have any Rigidbodies, Colliders, etc on them, they will consume a considerable amount of CPU. If you have disabled MeshRenderer and there are no more rednerers on the gameobject, than there will be 0 consumption of GPU. It will consume memory, inevitably.

Now since the object is active and working on the scene, even if it doesnt have any components and is essentially just an empty gameobject, it still will waste some CPU, but that amount will be negligable. For example if the gameobject has a tag, or a layer or if you have any Finds by name, in those cases it will consume some CPU.

The best way is to deactivate the GameObject and than re-Activate it when you need it SetActive(false/true);

Upvotes: 2

Related Questions