From the code it doesn't look like ClosestOnNode will do that. All it does is returns the start or end point of the path.
return start ? path.startPoint : path.endPoint;
- path.endPoint "(149.9, 0.0, 331.0)" UnityEngine.Vector3
- path.originalEndPoint "(149.2, 0.0, 331.7)" UnityEngine.Vector3
I disabled the modifiers without any improvement.
I didn't look at that section of the code prior to this but it looks like Original with useGraphRaycasting should do what I want, since those flags would abort going through impassible areas.
Edit I tried Original with useGraphRaycasting and it worked for what I wanted.I'll hold off on committing that change though because the comment in the inspector said ClosestOnNode should be faster.