If I have a destination(Vector3), How to know whether this coordinate is valid to call functionTeleport? I found this function will directly override the value of simulatedPos whitout judgement of the validity. Is there a way to get the graphic nodes of the destination and currentPos and check whether there is a connection between this two nodes?
Hi
What is your definition of “valid”?
If you want the closest point on the navmesh, use AstarPath.active.GetNearest(somePosition, NNConstraint.Default).position
.
If you need to know if the agent could have reached that point using a regular path, use PathUtilities.IsPathPossible