var start = AstarPath.instance.GetNearest(startPoint, NNConstraint.Default).node;
var end = AstarPath.instance.GetNearest(endPoint, NNConstraint.Default).node;
bool validPath = PathUtilities.IsPathPossible(start, end);
If you simply want the character to go to the closest point it can reach, then set ‘Exact End Point’ to ‘Closest On Node’ instead.