float GetAreaCost (int areaIndex)
Function Description
void Move ( movement)
Apply relative movement to current position.
void Resume ()
Resume the NavMesh agent.
void SetAreaCost (int areaIndex, float cost)
Sets the cost for traversing over areas of the area type.
void Stop ()
To stop the NavMesh agent.
void SetDestination ( position)
Set or update the destination.
void Warp ( position)
Warp to the position you want, also you can set agent's world position and vector to make this act as Move(SVector position).
bool Enabled get set
Enable or disable this component.
float Accelleration get set
The maximum acceleration of an agent as it follows a path.
float AngularSpeed get set
Maximum turning speed in while following a path.
int AreaMask get set
Specifies which NavMesh area is passable.
bool AutoRepath get set
Set the agent attempt to acquire a new path if the existing path becomes invalid.
bool AutoBraking get set
Set the agent brake automatically to avoid overshooting the destination point.
bool AutoTraverseOffMeshLink get set
Set the agent move across OffMeshLinks automatically.
int AvoidancePriority get set
The avoidance priority level.
float BaseOffset get set
The relative vertical displacement of the GameObject.
DesiredVelocity get
The desired velocity of the agent including any potential contribution from avoidance.
Destination get set
The desired velocity of the agent including any potential contribution from avoidance.
bool HasPath get
Does the agent currently have a path?
float Height get set
The height of the agent for purposes of passing under obstacles, etc.
bool IsOnNavMesh get
Is the agent currently bound to the navmesh?
bool IsOnOffMeshLink get
Is the agent currently positioned on an OffMeshLink?
bool IsPathStale get
Is the current path stale?
NextPosition get set
Get or set the simulation position of the navmesh agent.
PathEndPosition get
End positon of navigation.
bool PathPending get
Is a path in the process of being computed but not yet ready?
float Radius get set
The avoidance radius for the agent.
float RemainingDistance get
The distance between the agent's position and the destination on the current path.
float Speed get set
Maximum movement speed when following a path.
SteeringTarget get
Get the current steering target along the path.
float StoppingDistance get set
Stop within this distance from the target position.
bool UpdatePosition get set
Get or set whether the transform position is synchronized with the simulated agent position.
bool UpdateRotation get set
Should the agent update the transform orientation?
Velocity get
access the current velocity of the NavMeshAgent component, or set a velocity to control the agent manually.
GameObject get
Property Description
SVector get set
bool get
float get set
bool get
bool get
bool get
SVector get set
SVector get
bool get
float get set
float get
float get set
SVector get
float get set
bool get set
bool get set
SVector get
SGameObject get
float GetAreaCost (int areaIndex)
void Move (SVector movement)
void Resume ()
void SetAreaCost (int areaIndex, float cost)
void Stop ()
void SetDestination (SVector position)
void Warp (SVector position)
bool Enabled get set
float Accelleration get set
float AngularSpeed get set
int AreaMask get set
bool AutoRepath get set
bool AutoBraking get set
bool AutoTraverseOffMeshLink get set
int AvoidancePriority get set
float BaseOffset get set
SVector get
floatCost = Space.Host.ExecutingObject.NavMeshAgent.GetAreaCost(1)Space.Host.ExecutingObject.NavMeshAgent.Move(Vector.New(2,0,0))Space.Host.ExecutingObject.NavMeshAgent.Resume()agentobject = Space.Scene.Find("Cube")
agent = agentobject.NavMeshAgent
if agent == nil then
agent = Space.Scene.Find("Cube").AddNavMeshAgent()
end
counts = 0
--stop first, then resume.
function StopAndResume()
counts = counts +1
if counts > 10 then
agent.Stop()
end
if counts > 50 then
agent.Resume()
end
end
agentobject.SubscribeToEvents()
agentobject.OnUpdate(StopAndResume)
agent.Destination = Space.Scene.Find("TargetTransform").WorldPosition
--set destination.Space.Host.ExecutingObject.NavMeshAgent.SetAreaCost(1, 10.0)Space.Host.ExecutingObject.NavMeshAgent.Stop()Space.Host.ExecutingObject.NavMeshAgent.SetDestination(Vector.New(10,0,0))Space.Host.ExecutingObject.NavMeshAgent.Warp(Vector.New(10,0,0))Space.Host.ExecutingObject.NavMeshAgent.Enabled = false--clicking this object will Enable/Disable it's Nav Mesh Agent component
thisGameObject = Space.Host.ExecutingObject
component = thisGameObject.NavMeshAgent
OnClick = function()
component.Enabled = not component.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)Space.Host.ExecutingObject.NavMeshAgent.Accelleration = 60Space.Host.ExecutingObject.NavMeshAgent.AngularSpeed = 60Space.Host.ExecutingObject.NavMeshAgent.AreaMask = 3Space.Host.ExecutingObject.NavMeshAgent.AutoRepath = falseSpace.Host.ExecutingObject.NavMeshAgent.AutoBraking = falseSpace.Host.ExecutingObject.NavMeshAgent.AutoTraverseOffMeshLink = falseSpace.Host.ExecutingObject.NavMeshAgent.AvoidancePriority = 10Space.Host.ExecutingObject.NavMeshAgent.BaseOffset = 3vectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.DesiredVelocitySpace.Host.ExecutingObject.NavMeshAgent.Destination = Vector.New(10,0,0)hasPath = Space.Host.ExecutingObject.NavMeshAgent.HasPathSpace.Host.ExecutingObject.NavMeshAgent.Height = 5isOn = Space.Host.ExecutingObject.NavMeshAgent.IsOnNavMeshisOnOff = Space.Host.ExecutingObject.NavMeshAgent.IsOnOffMeshLinkisStale = Space.Host.ExecutingObject.NavMeshAgent.IsPathStaleSpace.Host.ExecutingObject.NavMeshAgent.NextPosition = Vector.New(10, 0, 0)vectorPathEndPos = Space.Host.ExecutingObject.NavMeshAgent.PathEndPositionisPending = Space.Host.ExecutingObject.NavMeshAgent.PathPendingSpace.Host.ExecutingObject.NavMeshAgent.Radius = 5vectorDist = Space.Host.ExecutingObject.NavMeshAgent.RemainingDistanceSpace.Host.ExecutingObject.NavMeshAgent.Speed = 20vectorSteeringTarget = Space.Host.ExecutingObject.NavMeshAgent.SteeringTargetSpace.Host.ExecutingObject.NavMeshAgent.StoppingDistance = 2Space.Host.ExecutingObject.NavMeshAgent.UpdatePosition = trueSpace.Host.ExecutingObject.NavMeshAgent.UpdateRotation = truevectorVelocity = Space.Host.ExecutingObject.NavMeshAgent.VelocitytheGameObject = Space.Host.ExecutingObject.NavMeshAgent.GameObject