RichAI SetPath(null) pushing AI off (recast) navmesh

In the game I’m working on I was encountering scenarios where my enemies would go through walls.

In trying to reproduce the issue in a test scenario I eventually found that this happens because they push eachother! I then attempted to reproduce the issue in a much more simple scenario, eventually I was able to easily reproduce it in a scene in the sample project, albiet with a few additions (you can see all I did below).

A small video of what happens:
ezgif-2-5ac1060edd

Scene details:

  • Using Example3_Recast_Navmesh1
  • Added two static blocks to trap AI’s inside in navmesh
  • Added RVOSimulator
  • Modified bots to use RichAI instead of AIPath (didn’t test AIPath)
  • Modified bots to have an RVOController
  • Modified bot speed/rotation settings a little bit to more closely match my game
  • Added a script “IssueTesting” to the bot that will execute SetPath(null) once every 3 seconds.

Project Details:

  • Unity 2021.2.7f1
  • Pathfinding project 4.3.47
  • Made sure to use a fresh version of the package without my custom changes this time :slight_smile:

Hi

This is expected given the current implementation. The RichAI uses the triangles in the path itself to keep itself on the navmesh. If it does not have a path it cannot constrain itself to the navmesh.

If you just want the agents to stop I would recommend using ai.isStopped instead of clearing the path.

1 Like

Thanks for the clarification!