What do you think is better for performance?
- Thousands of objects checking for enemies around via code?
- Or thousands of objects checking for nearby enemies with its attached, say Circle collider?
So lets say you have turret and it checks for enemies around it if they are close.
Both have advantages and disadvantages. Getting vector and sqrMagnitude and then comparing it to nearest object, can have have lag spikes if doing it for thousands of objects lets say every 1 second.
But having additional thousands of moving colliders on scene can have impact too.
↧