Enemies getting stuck on each other while pathfinding

Godot Version




Hi, I’m new to game dev, so sorry if this is a noob question. I added some enemies with pathfinding and they get stuck on each while turning corners. Is this something I can fix by editing my node’s properties, or do I need to write some custom script to fix this?

For context I’m trying to prototype a 2d game where the player has to navigate through a crowd of mobs


This looks like your agents are stuck on their physics shapes trying to reach the path points on the corner edges.

Disable the physics collision and if this fixes it you need to increase the agent parameters for its size to match your physics shape.

Depending on your navmesh layout you also need to increase the desired distances else your agents will try to backtrack to the path point if pushed away from it by physics collision or avoidance.

If a path point is “permanently” blocked by a physics shape or other agent there is no way that an agent can proceed its path. If such objects stay for long they need to be (re)baked into the navmesh so that the pathfinding understands that it can not use that surface area.