NavMeshAgent
7/14/25About 4 min
NavMeshAgent
Info
NavMeshAgent inherits from [Behaviour](/docs/create/lua/API/Behaviour/index.html)
Navigation mesh agent.
Members
Properties
| Name | Description |
|---|---|
NavMeshAgent.acceleration | The maximum acceleration of an agent as it follows a path, given in units / sec^2. |
NavMeshAgent.agentTypeID | The type ID for the agent. |
NavMeshAgent.angularSpeed | Maximum turning speed in (deg/s) while following a path. |
NavMeshAgent.areaMask | Specifies which NavMesh areas are passable. |
NavMeshAgent.autoBraking | Should the agent brake automatically to avoid overshooting the destination point? |
NavMeshAgent.autoRepath | Should the agent attempt to acquire a new path if the existing path becomes invalid? |
NavMeshAgent.autoTraverseOffMeshLink | Should the agent move across OffMeshLinks automatically? |
NavMeshAgent.avoidancePriority | The avoidance priority level. |
NavMeshAgent.baseOffset | The relative vertical displacement of the owning GameObject. |
NavMeshAgent.currentOffMeshLinkData | The current OffMeshLinkData. |
NavMeshAgent.desiredVelocity | The desired velocity of the agent including any potential contribution from avoidance. (Read Only) |
NavMeshAgent.destination | Gets or attempts to set the destination of the agent in world-space units. |
NavMeshAgent.hasPath | Does the agent currently have a path? (Read Only) |
NavMeshAgent.height | The height of the agent for purposes of passing under obstacles, etc. |
NavMeshAgent.isOnNavMesh | Is the agent currently bound to the navmesh? (Read Only) |
NavMeshAgent.isOnOffMeshLink | Is the agent currently positioned on an OffMeshLink? (Read Only) |
NavMeshAgent.isPathStale | Is the current path stale. (Read Only) |
NavMeshAgent.isStopped | This property holds the stop or resume condition of the NavMesh agent. |
NavMeshAgent.navMeshOwner | Returns the owning object of the NavMesh the agent is currently placed on (Read Only). |
NavMeshAgent.nextOffMeshLinkData | The next OffMeshLinkData on the current path. |
NavMeshAgent.nextPosition | Gets or sets the simulation position of the navmesh agent. |
NavMeshAgent.obstacleAvoidanceType | The level of quality of avoidance. |
NavMeshAgent.path | Property to get and set the current path. |
NavMeshAgent.pathPending | s a path in the process of being computed but not yet ready? (Read Only) |
NavMeshAgent.pathStatus | The status of the current path (complete, partial or invalid). |
NavMeshAgent.radius | The avoidance radius for the agent. |
NavMeshAgent.remainingDistance | The distance between the agent's position and the destination on the current path. (Read Only) |
NavMeshAgent.speed | Maximum movement speed when following a path. |
NavMeshAgent.steeringTarget | Get the current steering target along the path. (Read Only) |
NavMeshAgent.stoppingDistance | Stop within this distance from the target position. |
NavMeshAgent.updatePosition | Gets or sets whether the transform position is synchronized with the simulated agent position. The default value is true. |
NavMeshAgent.updateRotation | Should the agent update the transform orientation? |
NavMeshAgent.updateUpAxis | Allows you to specify whether the agent should be aligned to the up-axis of the NavMesh or link that it is placed on. |
NavMeshAgent.velocity | Access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually. |
Methods
| Name | Description |
|---|---|
NavMeshAgent.ActivateCurrentOffMeshLink(activated) | Enables or disables the current off-mesh link. |
NavMeshAgent.CalculatePath(targetPosition, path) | Calculate a path to a specified point and store the resulting path. |
NavMeshAgent.CompleteOffMeshLink() | Completes the movement on the current OffMeshLink. |
NavMeshAgent.FindClosestEdge() | Locate the closest NavMesh edge. |
NavMeshAgent.GetAreaCost(areaIndex) | Gets the cost for path calculation when crossing area of a particular type. |
NavMeshAgent.Move(offset) | Apply relative movement to current position. |
NavMeshAgent.Raycast(targetPosition) | Trace a straight path towards a target postion in the NavMesh without moving the agent. |
NavMeshAgent.ResetPath() | Clears the current path. |
NavMeshAgent.SamplePathPosition(areaMask, maxDistance) | Sample a position along the current path. |
NavMeshAgent.SetAreaCost(areaIndex, areaCost) | Sets the cost for traversing over areas of the area type. |
NavMeshAgent.SetDestination(target) | Sets or updates the destination thus triggering the calculation for a new path. |
NavMeshAgent.SetPath(path) | Assign a new path to this agent. |
NavMeshAgent.Warp(newPosition) | Warps agent to the provided position. |
Inherited Members
Inherited Properties
| Name | Description |
|---|---|
NavMeshAgent.enabled | Enabled Behaviours are Updated, disabled Behaviours are not. |
NavMeshAgent.isActiveAndEnabled | Has the Behaviour had active and enabled called? |
NavMeshAgent.gameObject | The game object this component is attached to. A component is always attached to a game object. |
NavMeshAgent.tag | The tag of this game object. |
NavMeshAgent.transform | The Transform attached to this GameObject. |
NavMeshAgent.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
NavMeshAgent.name | The name of the object. |
Inherited Methods
| Name | Description |
|---|---|
NavMeshAgent.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
NavMeshAgent.CompareTag(tag) | Is this game object tagged with tag ? |
NavMeshAgent.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
NavMeshAgent.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
NavMeshAgent.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
NavMeshAgent.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
NavMeshAgent.GetComponents(type) | Returns all components of Type type in the GameObject. |
NavMeshAgent.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
NavMeshAgent.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
NavMeshAgent.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
NavMeshAgent.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
NavMeshAgent.TryGetComponent(type) | Gets the component of the specified type, if it exists. |
NavMeshAgent.GetInstanceID() | Returns the instance id of the object. |
Extra Detail
This component is attached to a mobile character in the game to allow it to navigate the Scene using the NavMesh.

