How do I find the node I am pathing to?

When my seeker script finds a path, if the location I told it to go to is unreachable, it instead finds the node that is closest to that point.
I like this feature, but I’m having some problems with some custom scripts, and I need to know what this new point is that the path set as a new goal.

How do I retrieve that information? How do I see what the current path set as my target destination (when said target is different from the one I supplied)?

Hi

Are you using a custom movement script and calculating your paths yourself?

In that case you can check the final entry in the path.path list, in your OnPathComplete method:

void OnPathComplete(Path path) {
    var p = path as ABPath;
    Debug.DrawRay((Vector3)p.path[p.path.Count - 1].position, Vector3.up, Color.red);
}