Skip to main content

NavMeshAgent

info

NavMeshAgent inherits from Behaviour

Navigation mesh agent.

Members

Properties

NameDescription
NavMeshAgent.accelerationThe maximum acceleration of an agent as it follows a path, given in units / sec^2.
NavMeshAgent.agentTypeIDThe type ID for the agent.
NavMeshAgent.angularSpeedMaximum turning speed in (deg/s) while following a path.
NavMeshAgent.areaMaskSpecifies which NavMesh areas are passable.
NavMeshAgent.autoBrakingShould the agent brake automatically to avoid overshooting the destination point?
NavMeshAgent.autoRepathShould the agent attempt to acquire a new path if the existing path becomes invalid?
NavMeshAgent.autoTraverseOffMeshLinkShould the agent move across OffMeshLinks automatically?
NavMeshAgent.avoidancePriorityThe avoidance priority level.
NavMeshAgent.baseOffsetThe relative vertical displacement of the owning GameObject.
NavMeshAgent.currentOffMeshLinkDataThe current OffMeshLinkData.
NavMeshAgent.desiredVelocityThe desired velocity of the agent including any potential contribution from avoidance. (Read Only)
NavMeshAgent.destinationGets or attempts to set the destination of the agent in world-space units.
NavMeshAgent.hasPathDoes the agent currently have a path? (Read Only)
NavMeshAgent.heightThe height of the agent for purposes of passing under obstacles, etc.
NavMeshAgent.isOnNavMeshIs the agent currently bound to the navmesh? (Read Only)
NavMeshAgent.isOnOffMeshLinkIs the agent currently positioned on an OffMeshLink? (Read Only)
NavMeshAgent.isPathStaleIs the current path stale. (Read Only)
NavMeshAgent.isStoppedThis property holds the stop or resume condition of the NavMesh agent.
NavMeshAgent.navMeshOwnerReturns the owning object of the NavMesh the agent is currently placed on (Read Only).
NavMeshAgent.nextOffMeshLinkDataThe next OffMeshLinkData on the current path.
NavMeshAgent.nextPositionGets or sets the simulation position of the navmesh agent.
NavMeshAgent.obstacleAvoidanceTypeThe level of quality of avoidance.
NavMeshAgent.pathProperty to get and set the current path.
NavMeshAgent.pathPendings a path in the process of being computed but not yet ready? (Read Only)
NavMeshAgent.pathStatusThe status of the current path (complete, partial or invalid).
NavMeshAgent.radiusThe avoidance radius for the agent.
NavMeshAgent.remainingDistanceThe distance between the agent's position and the destination on the current path. (Read Only)
NavMeshAgent.speedMaximum movement speed when following a path.
NavMeshAgent.steeringTargetGet the current steering target along the path. (Read Only)
NavMeshAgent.stoppingDistanceStop within this distance from the target position.
NavMeshAgent.updatePositionGets or sets whether the transform position is synchronized with the simulated agent position. The default value is true.
NavMeshAgent.updateRotationShould the agent update the transform orientation?
NavMeshAgent.updateUpAxisAllows you to specify whether the agent should be aligned to the up-axis of the NavMesh or link that it is placed on.
NavMeshAgent.velocityAccess the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.

Methods

NameDescription
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

NameDescription
NavMeshAgent.enabledEnabled Behaviours are Updated, disabled Behaviours are not.
NavMeshAgent.isActiveAndEnabledHas the Behaviour had active and enabled called?
NavMeshAgent.gameObjectThe game object this component is attached to. A component is always attached to a game object.
NavMeshAgent.tagThe tag of this game object.
NavMeshAgent.transformThe Transform attached to this GameObject.
NavMeshAgent.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
NavMeshAgent.nameThe name of the object.

Inherited Methods

NameDescription
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.