Support Forum

How to allow agents pass through each other while pathing?

Hi Aron,

I am using GridGraph as Graph and I am navigating using AIPath and a custom script in an RTS game. I want to allow units to pass through each other while navigating but I am unable to find a solution regarding that. In my scenario, I have formation of units which get restructured after every movement command, so it gets really weird when units are avoiding each other during the restructuring, they push each other disturbing rotation/position of other units and resultant formations look bad.

Ideally, I want a solution where where I can disable this avoidance at some times and enable at others, but permanently disabling the avoidance and letting units pass through each other will work too.

For reference, in Unity NavMesh, setting “Obstacle Avoidance” to None on “NavMeshAgent” does what I want. I shifted for Unity NavMesh to A* because it takes a lot of time to compute path for large number of units, which is handled better in A*. I hope there is a way to solve my current issue.

Thanks in advance.

Hi

I assume you are using the local avoidance in this package. In that case simply set the “collides with” mask to “Nothing” whenever you want to disable avoidance of other units.