Class NavMeshAgent
Assembly: UnityEngine.dll
Syntax
[MovedFrom("UnityEngine")]
public sealed class NavMeshAgent : Behaviour
Properties
acceleration
Declaration
public float acceleration { get; set; }
Property Value
agentTypeID
Declaration
public int agentTypeID { get; set; }
Property Value
angularSpeed
Declaration
public float angularSpeed { get; set; }
Property Value
areaMask
Declaration
public int areaMask { get; set; }
Property Value
autoBraking
Declaration
public bool autoBraking { get; set; }
Property Value
autoRepath
Declaration
public bool autoRepath { get; set; }
Property Value
autoTraverseOffMeshLink
Declaration
public bool autoTraverseOffMeshLink { get; set; }
Property Value
avoidancePriority
Declaration
public int avoidancePriority { get; set; }
Property Value
baseOffset
Declaration
public float baseOffset { get; set; }
Property Value
|
Improve this Doc
View Source
currentOffMeshLinkData
Declaration
public OffMeshLinkData currentOffMeshLinkData { get; }
Property Value
|
Improve this Doc
View Source
desiredVelocity
Declaration
public Vector3 desiredVelocity { get; }
Property Value
|
Improve this Doc
View Source
destination
Declaration
public Vector3 destination { get; set; }
Property Value
hasPath
Declaration
public bool hasPath { get; }
Property Value
height
Declaration
public float height { get; set; }
Property Value
isOnNavMesh
Declaration
public bool isOnNavMesh { get; }
Property Value
isOnOffMeshLink
Declaration
public bool isOnOffMeshLink { get; }
Property Value
isPathStale
Declaration
public bool isPathStale { get; }
Property Value
isStopped
Declaration
public bool isStopped { get; set; }
Property Value
|
Improve this Doc
View Source
navMeshOwner
Declaration
public Object navMeshOwner { get; }
Property Value
|
Improve this Doc
View Source
nextOffMeshLinkData
Declaration
public OffMeshLinkData nextOffMeshLinkData { get; }
Property Value
|
Improve this Doc
View Source
nextPosition
Declaration
public Vector3 nextPosition { get; set; }
Property Value
obstacleAvoidanceType
Declaration
public ObstacleAvoidanceType obstacleAvoidanceType { get; set; }
Property Value
|
Improve this Doc
View Source
path
Declaration
public NavMeshPath path { get; set; }
Property Value
|
Improve this Doc
View Source
pathEndPosition
Declaration
public Vector3 pathEndPosition { get; }
Property Value
pathPending
Declaration
public bool pathPending { get; }
Property Value
pathStatus
Declaration
public NavMeshPathStatus pathStatus { get; }
Property Value
radius
Declaration
public float radius { get; set; }
Property Value
remainingDistance
Declaration
public float remainingDistance { get; }
Property Value
speed
Declaration
public float speed { get; set; }
Property Value
|
Improve this Doc
View Source
steeringTarget
Declaration
public Vector3 steeringTarget { get; }
Property Value
stoppingDistance
Declaration
public float stoppingDistance { get; set; }
Property Value
updatePosition
Declaration
public bool updatePosition { get; set; }
Property Value
updateRotation
Declaration
public bool updateRotation { get; set; }
Property Value
updateUpAxis
Declaration
public bool updateUpAxis { get; set; }
Property Value
|
Improve this Doc
View Source
velocity
Declaration
public Vector3 velocity { get; set; }
Property Value
walkableMask
Declaration
[Obsolete("Use areaMask instead.")]
public int walkableMask { get; set; }
Property Value
Methods
ActivateCurrentOffMeshLink(Boolean)
Declaration
public void ActivateCurrentOffMeshLink(bool activated)
Parameters
Type |
Name |
Description |
Boolean |
activated |
|
|
Improve this Doc
View Source
CalculatePath(Vector3, NavMeshPath)
Declaration
public bool CalculatePath(Vector3 targetPosition, NavMeshPath path)
Parameters
Returns
CompleteOffMeshLink()
Declaration
public void CompleteOffMeshLink()
FindClosestEdge(out NavMeshHit)
Declaration
public bool FindClosestEdge(out NavMeshHit hit)
Parameters
Returns
GetAreaCost(Int32)
Declaration
public float GetAreaCost(int areaIndex)
Parameters
Type |
Name |
Description |
Int32 |
areaIndex |
|
Returns
GetLayerCost(Int32)
Declaration
[Obsolete("Use GetAreaCost instead.")]
public float GetLayerCost(int layer)
Parameters
Type |
Name |
Description |
Int32 |
layer |
|
Returns
|
Improve this Doc
View Source
Move(Vector3)
Declaration
public void Move(Vector3 offset)
Parameters
Type |
Name |
Description |
Vector3 |
offset |
|
|
Improve this Doc
View Source
Raycast(Vector3, out NavMeshHit)
Declaration
public bool Raycast(Vector3 targetPosition, out NavMeshHit hit)
Parameters
Returns
ResetPath()
Declaration
Resume()
Declaration
[Obsolete("Set isStopped to false instead")]
public void Resume()
SamplePathPosition(Int32, Single, out NavMeshHit)
Declaration
public bool SamplePathPosition(int areaMask, float maxDistance, out NavMeshHit hit)
Parameters
Returns
SetAreaCost(Int32, Single)
Declaration
public void SetAreaCost(int areaIndex, float areaCost)
Parameters
|
Improve this Doc
View Source
SetDestination(Vector3)
Declaration
public bool SetDestination(Vector3 target)
Parameters
Type |
Name |
Description |
Vector3 |
target |
|
Returns
SetLayerCost(Int32, Single)
Declaration
[Obsolete("Use SetAreaCost instead.")]
public void SetLayerCost(int layer, float cost)
Parameters
SetPath(NavMeshPath)
Declaration
public bool SetPath(NavMeshPath path)
Parameters
Returns
|
Improve this Doc
View Source
Stop()
Declaration
[Obsolete("Set isStopped to true instead")]
public void Stop()
|
Improve this Doc
View Source
Stop(Boolean)
Declaration
[Obsolete("Set isStopped to true instead")]
public void Stop(bool stopUpdates)
Parameters
Type |
Name |
Description |
Boolean |
stopUpdates |
|
|
Improve this Doc
View Source
Warp(Vector3)
Declaration
public bool Warp(Vector3 newPosition)
Parameters
Type |
Name |
Description |
Vector3 |
newPosition |
|
Returns
Extension Methods