Moving enemies around player?

I am making a top down 2d game with AI that path-find to the player. If the player takes enough damage to the player then the enemies will move to the opposite end of the map, to give the player time to get back on their feet. The issue is if the player is in the path of that the enemy wants to go in, it will just get stuck on the player.

Is there a way to make the enemies path-find around the player, to avoid them getting stuck?


If you’re using the Pro version of the package you can make use of the RVO component.
Here is an example of how to add the player as obstacle for the RVO agents from the documentation:

Alternatively depending on what graph you’re using you can make use of the ITraversableInterface to block the player occupied node from being used by the agents.
Example can be found here:

1 Like