A* Pathfinding Project

AIPath getting stuck turning too soon


I am using a grid graph. And followed the ‘Getting Started’ section to just to make sure that I did it right. Only difference is that I have the node size set to 0.33.

The Agent’s destination is directly in front of it from the start. But to get to it it needs to go through a gap between 2 walls that is just off to one side of it. It gets close but then turns, facing directly at the wall.

If any additional info is need please let me know.




You’ll want to decrease the pickNextWayPointDistance.
There is a good explanation of what it does here: https://arongranberg.com/astar/docs/aipath.html


Oh, thanks! Do you you have any suggestions on what size I should make the cells, and what value pickNextWayPointDistance should be set to?
The AI will mostly be in interiors of buildings, with small obstacle like chairs, tables, etc. And not having a lot of room some times.