Skip to content

API > NavMeshAgent


NavMeshAgent⚓︎

NavMeshAgent inherits from Behaviour

Navigation mesh agent.

Members⚓︎

Properties⚓︎

Name Description
NavMeshAgent.accelerationProperty The maximum acceleration of an agent as it follows a path, given in units / sec^2.
NavMeshAgent.agentTypeIDProperty The type ID for the agent.
NavMeshAgent.angularSpeedProperty Maximum turning speed in (deg/s) while following a path.
NavMeshAgent.areaMaskProperty Specifies which NavMesh areas are passable.
NavMeshAgent.autoBrakingProperty Should the agent brake automatically to avoid overshooting the destination point?
NavMeshAgent.autoRepathProperty Should the agent attempt to acquire a new path if the existing path becomes invalid?
NavMeshAgent.autoTraverseOffMeshLinkProperty Should the agent move across OffMeshLinks automatically?
NavMeshAgent.avoidancePriorityProperty The avoidance priority level.
NavMeshAgent.baseOffsetProperty The relative vertical displacement of the owning GameObject.
NavMeshAgent.currentOffMeshLinkDataProperty The current OffMeshLinkData.
NavMeshAgent.desiredVelocityProperty The desired velocity of the agent including any potential contribution from avoidance. (Read Only)
NavMeshAgent.destinationProperty Gets or attempts to set the destination of the agent in world-space units.
NavMeshAgent.hasPathProperty Does the agent currently have a path? (Read Only)
NavMeshAgent.heightProperty The height of the agent for purposes of passing under obstacles, etc.
NavMeshAgent.isOnNavMeshProperty Is the agent currently bound to the navmesh? (Read Only)
NavMeshAgent.isOnOffMeshLinkProperty Is the agent currently positioned on an OffMeshLink? (Read Only)
NavMeshAgent.isPathStaleProperty Is the current path stale. (Read Only)
NavMeshAgent.isStoppedProperty This property holds the stop or resume condition of the NavMesh agent.
NavMeshAgent.navMeshOwnerProperty Returns the owning object of the NavMesh the agent is currently placed on (Read Only).
NavMeshAgent.nextOffMeshLinkDataProperty The next OffMeshLinkData on the current path.
NavMeshAgent.nextPositionProperty Gets or sets the simulation position of the navmesh agent.
NavMeshAgent.obstacleAvoidanceTypeProperty The level of quality of avoidance.
NavMeshAgent.pathProperty Property to get and set the current path.
NavMeshAgent.pathPendingProperty s a path in the process of being computed but not yet ready? (Read Only)
NavMeshAgent.pathStatusProperty The status of the current path (complete, partial or invalid).
NavMeshAgent.radiusProperty The avoidance radius for the agent.
NavMeshAgent.remainingDistanceProperty The distance between the agent's position and the destination on the current path. (Read Only)
NavMeshAgent.speedProperty Maximum movement speed when following a path.
NavMeshAgent.steeringTargetProperty Get the current steering target along the path. (Read Only)
NavMeshAgent.stoppingDistanceProperty Stop within this distance from the target position.
NavMeshAgent.updatePositionProperty Gets or sets whether the transform position is synchronized with the simulated agent position. The default value is true.
NavMeshAgent.updateRotationProperty Should the agent update the transform orientation?
NavMeshAgent.updateUpAxisProperty 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.velocityProperty Access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.

Methods⚓︎

Name Description
NavMeshAgent.ActivateCurrentOffMeshLink(activated) Method Enables or disables the current off-mesh link.
NavMeshAgent.CalculatePath(targetPosition, path) Method Calculate a path to a specified point and store the resulting path.
NavMeshAgent.CompleteOffMeshLink() Method Completes the movement on the current OffMeshLink.
NavMeshAgent.FindClosestEdge() Method Locate the closest NavMesh edge.
NavMeshAgent.GetAreaCost(areaIndex) Method Gets the cost for path calculation when crossing area of a particular type.
NavMeshAgent.Move(offset) Method Apply relative movement to current position.
NavMeshAgent.Raycast(targetPosition) Method Trace a straight path towards a target postion in the NavMesh without moving the agent.
NavMeshAgent.ResetPath() Method Clears the current path.
NavMeshAgent.SamplePathPosition(areaMask, maxDistance) Method Sample a position along the current path.
NavMeshAgent.SetAreaCost(areaIndex, areaCost) Method Sets the cost for traversing over areas of the area type.
NavMeshAgent.SetDestination(target) Method Sets or updates the destination thus triggering the calculation for a new path.
NavMeshAgent.SetPath(path) Method Assign a new path to this agent.
NavMeshAgent.Warp(newPosition) Method Warps agent to the provided position.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
NavMeshAgent.enabledProperty Enabled Behaviours are Updated, disabled Behaviours are not.
NavMeshAgent.isActiveAndEnabledProperty Has the Behaviour had active and enabled called?
NavMeshAgent.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
NavMeshAgent.tagPropertyReadonly Property The tag of this game object.
NavMeshAgent.transformPropertyReadonly Property The Transform attached to this GameObject.
NavMeshAgent.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
NavMeshAgent.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
NavMeshAgent.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
NavMeshAgent.CompareTag(tag)Method Is this game object tagged with tag ?
NavMeshAgent.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
NavMeshAgent.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
NavMeshAgent.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
NavMeshAgent.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
NavMeshAgent.GetComponents(type)Method Returns all components of Type type in the GameObject.
NavMeshAgent.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
NavMeshAgent.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
NavMeshAgent.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
NavMeshAgent.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
NavMeshAgent.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
NavMeshAgent.GetInstanceID()Method 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.