Hi
I have game, it has many objects 500+, I store each created objects in this array and remove from array the objects that are destroyed.
Now my Question is: How do I loop through this array/database?
I need to activate/deactivate objects that are close/far enough from Player.
(So also inactive objects has to get active later)
The problem is ofc, the array will have holes like objectDatabase[5] = null but objectDatabase[7] = someObjectStored.
If I make foreach loop, it will crash ofcourse. Any ideas please?
(Don`t suggest object pooling pls it`s completely impractical for me)
↧