Skip to main content

NavMeshAgent.destination

NameType
destinationVector3

Description

Gets or attempts to set the destination of the agent in world-space units.

Extra Detail

Getting:
Returns the destination set for this agent.


• If a destination is set but the path is not yet processed the position returned will be valid navmesh position that's closest to the previously set position.
• If the agent has no path or requested path - returns the agents position on the navmesh.
• If the agent is not mapped to the navmesh (e.g. Scene has no navmesh) - returns a position at infinity.


Setting:


Requests the agent to move to the valid navmesh position that's closest to the requested destination.