AI Path Script goes crazy

All characters begin to move back and forth even though the path is correctly calculated. Please watch this short video.
It starts after adding about 100 obstacles during runtime. Is this a known bug or am I doing something wrong? My test case is really simple. I can provide the project if necessary.

Link to the Video:

Hi

This is due to a high load on the pathfinding system.
An agent might request a path when it is at some point, but since it takes some time for the path to be calculated, the agent will have moved when it gets the result back. The AIPath script tries to fix this (assuming the closestOnPathCheck field is enabled) but it cannot do it at all times. The solution is to reduce the load on the pathfinding system and the game. First, make sure you have multithreading enabled (A* Inspector -> Settings), also it is probably a good idea to turn off Show Graphs for larger graphs since drawing that is pretty slow and will reduce the fps significantly. You can also increase the pickNextWaypointDistance and the forwardLook fields on the AIPath script, that will reduce the chance of this happening.

Thank you so much Aron for your reply.
I watched your stress test: https://www.youtube.com/watch?v=htoen7x3LuQ and you wrote in the description this “The AI’s are really simple but they do use path simplification using raycasting”. How can I enable this path simplification using raycasting?

Hi

If I remember correctly I used the Raycast Modifier component.

1 Like