A* Pathfinding Project

PickNextWaypointDist


#1

Hi~

How do I get to the center of a node without being affected by PickNextWaypointDist in AIPath?


#2

Hey,

Do you mean node,Position?
This will give you the position of a node.
(https://arongranberg.com/astar/docs/graphnode.html#position)


#3

It automatically checks the PickNextWaypointDist range and modifies the path when the object moves along the path. I want to get rid of this. I just want to move to the center of the node. I’d appreciate it if you could tell me how.


#4

Hey,

moving to the exact location of a node should mostly be avoided. An agent almost never truly reaches the exact same position.

You could simply lower the value of Pick Next Waypoint Dist
Though I’d advise against making it 0, instead I’d opt for a value like 0.1f

Hope that helps,
Wolf

ps. I do have some custom properties here, so your AI path won’t look identical, but similar.


#5

Hi

If you want the agent to move precisely along the path you might want to use the AILerp movement script instead. It follows the path without any physics. See https://arongranberg.com/astar/docs/movementscripts.html