In an RTS game, how to let the hero automatically push away other units?

Hi, I am developing an RTS game with Unity’s NavMesh. But I want the heroes in the game to automatically push away the units in the way, but I can’t find a perfect way to achieve it.

I tried a way to set the Avoidance Quality of the hero’s NavMeshAgent to None. Although I can get the result I want. But then the heroes will overlap and no longer collide.

So I want to ask if there are other better ways to achieve that.

And in fact, I wanted heavy units to automatically push away other light units, but this is more difficult to achieve.

Just change the hero’s agent avoidance priority to a lower number than of those of regular units (default is 50 I think).

2 Likes

Oh, thank you very much !
:sweat_smile:It turns out that this is the usage of avoidance priority…