I’m in the middle of making a tower defense game. As is standard in the genre, there is going to be a lot of little enemies on the scene at any given time which got me thinking: are colliders efficient in this context? I did some digging but the only thing I learned was that capsules are apparently the most efficient collider followed by sphere and then box. So, my question remains, should I be using colliders for each enemy or using an alternative method? My current thought on that would be to have each enemy send it’s position to a script and determine all my calculations off that. Thoughts on colliders vs alternative solution and the alternative solution if that’d be more efficient? Thanks!
Spheres are more efficient than capsules, then boxes. Whether it’s efficient or not really depends on what calculations you intend to do with that collision information.
If your units only move on a simple grid, it would probably be more efficient to store their position information in an array and check that prior to movement. Do you need to perform collision checks every frame? If not, you may be better off using a coroutine rather than something like OnTriggerEnter(). Do you really need “collisions” as such, or just triggers? Also remember you can adjust the physics fixed timestep to alter the “resolution” of physics calculations.
And how good are you at coding? The Physx system may be a little bit overkill for what you need, but it has been developed, tested, and optimised by some pretty clever people. Any alternative solution you develop, however more efficient it may seem in principle, will only benefit it you if you are able to implement it as such.