Disabled Objects & Performance (SOLVED)

What sort of costs are associated with having lots of disabled objects?

I am loading a group of proxies, and enabling/disabling them selectively. Is it more efficient to load/unload them?

Edit: I am guessing there are memory concerns with keeping lots of game objects in a disabled state, but what about other costs? Does the engine need to inspect them each frame somehow? I am only asking because one of these collections is very large (a few hundred images).

~Charles

1 Like

It depends on the things being disabled. In the case of a collection proxy, the underlying collection will be completely ignored (no processing) when it’s disabled. In the case of other components, they remain in arrays so they will still be iterated over and their enablement will be checked (no other processing though). So if you had 100 sprites and you disabled 50 of them, we would still iterate over the 100 sprites (but not process the disabled ones).

6 Likes

Exactly the info I was looking for, Thanks!

3 Likes