Support Forum

Agents walk on top of each other (2D TopDown)


I am using the paid version of the A* Pathfinding project for a topdown 2D game.
I am using a grid graph.
My agents are using AIPath, a RVO Controller and Seeker.

The agents walk between several destinations, they avoid each other when they cross paths but when they walk from the same starting point to the same destination, they start to overlap and look like they merge and walk on top of each other, instead of walking next to each other with some distance in between.

The same thing happens sometimes when multiple agents arrive at a destination, where they overlap and disappear into each other.

How can I make the agents keep a distance from each other?

I’m sure there’s a simple solution but I can’t get to it, haha.



The local avoidance (RVO) should keep them from overlapping.

Do you mean that it works most of the time, but not in some cases? Would you mind showing screenshots of this and your character configuration?

Hi Aron!

Thanks for the quick reply.

While making the screenshots I realized that the agents never avoid each other, so it isn’t working at all and what I said in my original post wasn’t completely correct. If two agents need to go to the same destination, or if their paths cross each other in any kind of way, the agents start to overlap.

I have added a couple screenshots of the agents overlapping.

I am not sure if this is what you meant with character configuration, but these are the components on the agents (all have the same values).

Agent components 2

Do you have an RVOSimulator component in the scene?



Any suggestions on how to make the agents avoid each other? :slightly_smiling_face:

I’m not sure what’s wrong. Your settings look correct. Though your agent time horizon is really really high. I’d recommend lowering that to maybe 0.5-2 seconds.

Do you move the agents manually in some way?

Haha, I hoped that trying out higher values would have an effect, that’s why. I lowered it again but it does not really seem to have influence.

I do not move the agents manually. They get spawned in the scene at a random location and I have only tried moving them with the destination setter.

I don’t know if this could influence the local avoidance, but my agents have all pathfinding components in one gameobject, and in the children of that gameobject is all other logic (animation/sprite library/collider).