NavMeshAgentclass
An agent that can navigate the navmesh defined in the scene.
Constructors1
Showing 1 constructors
public NavMeshAgent()
No results match this filter.
Methods7
Showing 7 methods
public void CompleteLinkTraversal()
Ends custom link traversal at the current AgentPosition and resumes navigation.
void—public Sandbox.Navigation.NavMeshPath GetPath()
public void MoveTo(Vector3 targetPosition)
| Parameter | Type | Description |
|---|---|---|
| targetPosition | Vector3 | — |
void—public void SetAgentPosition(Vector3 position)
Explicitly repositions the simulated agent. Runtime GameObject transforms do not move it.
| Parameter | Type | Description |
|---|---|---|
| position | Vector3 | — |
void—public void SetPath(Sandbox.Navigation.NavMeshPath path)
Assigns a path calculated on this navmesh. The start must project onto the path's first polygon.
| Parameter | Type | Description |
|---|---|---|
| path | NavMeshPath | — |
void—public void Stop()
void—No results match this filter.
Properties20
Showing 20 properties
public float Sandbox.NavMeshAgent.Acceleration { get; set; }
The maximum acceleration a agent can have. This is how fast the agent can change its velocity. If you want snappy movement this should be as high or higher than `Sandbox.NavMeshAgent.MaxSpeed`.
float—public Vector3 Sandbox.NavMeshAgent.AgentPosition { get; set; }
The current simulated position, including when UpdatePosition is false.
public bool Sandbox.NavMeshAgent.AllowDefaultArea { get; set; }
Is the agent allowed to travel on the default area?
bool—public System.Collections.Generic.HashSet`1<Sandbox.Engine.Resources.NavMeshAreaDefinition> Sandbox.NavMeshAgent.AllowedAreas { get; set; }
What areas the agent is allowed to travel on. If empty, all areas are allowed.
public bool Sandbox.NavMeshAgent.AutoTraverseLinks { get; set; }
Should the agent automatically traverse links when it reaches them? Or do you want to implement your own link traversal logic?
bool—public System.Collections.Generic.HashSet`1<Sandbox.Engine.Resources.NavMeshAreaDefinition> Sandbox.NavMeshAgent.ForbiddenAreas { get; set; }
What areas the agent is not allowed to travel on. If empty, no areas are forbidden.
public float Sandbox.NavMeshAgent.Height { get; set; }
float—public bool Sandbox.NavMeshAgent.IsNavigating { get; set; }
bool—public bool Sandbox.NavMeshAgent.IsTraversingLink { get; set; }
bool—public System.Action Sandbox.NavMeshAgent.LinkEnter { get; set; }
Action—public System.Action Sandbox.NavMeshAgent.LinkExit { get; set; }
Action—public float Sandbox.NavMeshAgent.MaxSpeed { get; set; }
float—public float Sandbox.NavMeshAgent.Radius { get; set; }
float—public float Sandbox.NavMeshAgent.Separation { get; set; }
Gets or sets the separation factor used to control how strongly agents avoid crowding each other.
float—public bool Sandbox.NavMeshAgent.SyncAgentPosition { get; set; }
Obsolete: This API member is obsolete.
bool—public System.Nullable`1<Vector3> Sandbox.NavMeshAgent.TargetPosition { get; set; }
The requested target, or null when stopped.
public bool Sandbox.NavMeshAgent.UpdatePosition { get; set; }
Set the Position of the GameObject to the agent position every frame. You can turn this off and handle it yourself by using the AgentPosition property.
bool—public bool Sandbox.NavMeshAgent.UpdateRotation { get; set; }
This will simply face the direction it is moving. It is not configurable on purpose, so you should really turn this off and be doing this yourself if you need it to do anything specific.
bool—public Vector3 Sandbox.NavMeshAgent.Velocity { get; set; }
public Vector3 Sandbox.NavMeshAgent.WishVelocity { get; set; }
No results match this filter.