endReachedDistance for AI Lerp (2D)

Can we get this for 2D? for X Y plane? would really be lovely. :slight_smile:

Hi

The AILerp script can move to the target point exactly so there is no need for it to use a cutoff distance. The other scripts need it because they will only approximately reach the target point and a cutoff point is thus necessary.
What effect are you looking for?

Hi,

Well, for example I tried to do human, and a zombie is chasing him, but zombie needs to stop X units away from human to attack him, not on top of human.

Hi

Ok. Since the human is a target that is moving quickly, I would suggest that you do this check outside the pathfinding code. If the path is not updated often enough, moving X units away from the end of the path would make the zombie stop X units away from where the player was a few seconds ago. Checking the distance to the actual player character might be a better idea.

There is also a path type called XPath which you can set custom ending conditions for. See http://arongranberg.com/astar/docs/class_pathfinding_1_1_x_path.php