Hi,
Currently testing navmesh and agents and I find something odd.
If I set the destination to a position outside the navMesh, the agent stops at the navmesh limit but the remaining distance keeps decreasing until 0… which is wrong visually.
Is this the expected behavior and if so how I detect that an agent actually IS located at the destination. Comparing the position manually? seems odd and an api flag of some sort would be better I feel…
Thanks,
Jean
Thanks,
Jean
Hi Jean,
Before acquiring a path the destination point is mapped onto the walkable surface of the navmesh. This end-point (NavMeshAgent.destination) may differ from the world space position you assigned.
NavMeshAgent.remainingDistance is the remaining distance of the path you currently have (or infinite if not known) - not the distance to the world space position argument to the destination.
If the path destination is on a disconnected region of navmesh (with respect to the agent) - the resulting path will have the status “PathPartial”(NavMeshAgent.pathStatus)