Best way to do Collision detection when you have multiple enemies/allies around you
I have a game where I have multiple units. Each unit can belong to one of the two factions. On one unit I use Physics.OverlapSphere to check for collisions and I do believe that is working great.
Before this I was using a Box Collider on the main Parent to detect personal contact and another Sphere Collider as a Child in order to detect a rage where the Unity can to stuff, like engage for combat, cast a spell, etc.
So my question is, how to do this kind of detection? Which one is not that intensive? Is a Physics.OverlapSphere good enough if it runs on the Update?
One thing that I was thinking was to put my both factions on their own Layer and for example if I have an healer that only cares about detecting allies, I do a layerMask where I only tell it to look for allies.
How does this sound?
Thank You