What Space Partitioning is used for Sphere Collider Triggers?

Hey there, I had a question very similar to this, and was wondering, exactly how does Unity implement space partitioning with its physics? I.e. how does it actually check if a collider is in my trigger sphere?

I have a simple cell based partitioning system going in my RTS game, and was wondering if proximity (using dist squared) checks for all characters in my neighborhood would be faster than using Unity’s sphere trigger, or vice versa.

Thanks :slight_smile:

I would imagine Unity’s is “better” because you can’t turn it off. If you use your own, Unity is most likely still going to maintain an Oct-Tree, or whatever, and take the time to check in and out every collider that moves.

So, UnitySpacePartition + UnityTriggerChecks is almost for sure faster than UnitySpacePartition + yourPartitions + yourChecks. Maybe you could never use colliders, so Unity’s system never does any work, and use your own. But then you give up the buultin rayCasts and mouseOvers.