Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

NavMeshAgent

class in UnityEngine

/

Hereda de:Behaviour

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

Navigation mesh agent.

This component is attached to a mobile character in the game to allow it to navigate the scene using the NavMesh. See the Navigation section of the manual for further details.

Variables

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

Funciones Públicas

ActivateCurrentOffMeshLinkEnables or disables the current off-mesh link.
CalculatePathCalculate a path to a specified point and store the resulting path.
CompleteOffMeshLinkCompletes the movement on the current OffMeshLink.
FindClosestEdgeLocate the closest NavMesh edge.
GetAreaCostGets the cost for path calculation when crossing area of a particular type.
MoveApply relative movement to current position.
RaycastTrace a straight path towards a target postion in the NavMesh without moving the agent.
ResetPathClears the current path.
ResumeResumes the movement along the current path after a pause.
SamplePathPositionSample a position along the current path.
SetAreaCostSets the cost for traversing over areas of the area type.
SetDestinationSets or updates the destination thus triggering the calculation for a new path.
SetPathAssign a new path to this agent.
StopStop movement of this agent along its current path.
WarpWarps agent to the provided position.

Miembros heredados

Variables

enabledEnabled Behaviours are Updated, disabled Behaviours are not.
isActiveAndEnabledHas the Behaviour had enabled called.
gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagEl tag de este game object.
transformThe Transform attached to this GameObject (null if there is none attached).
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameEl nombre del objeto.

Funciones Públicas

BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringDevuelve el nombre del objeto.

Funciones Estáticas

DestroyElimina un gameobject, componente o asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateDevuelve el nombre del objeto.

Operadores

bool¿Existe el objeto?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.