s&
newspaper
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
rocket
Discover Games
business_center
Workshop
sports_esports
Games
landscape
Maps
chair
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
docs
Docs
docs
Documentation
dashboard
Api Reference
school
Tutorials
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Components
NavMeshAgent
chevron_left
Components
class
NavMeshAgent
search
Constructors
functions
NavMeshAgent
Fields
crop_din
CurrentLinkTraversal
Properties
data_object
Acceleration
data_object
AgentPosition
data_object
AllowDefaultArea
data_object
AllowedAreas
data_object
AutoTraverseLinks
data_object
ForbiddenAreas
data_object
Height
data_object
IsNavigating
data_object
IsTraversingLink
data_object
LinkEnter
data_object
LinkExit
data_object
MaxSpeed
data_object
Radius
data_object
Separation
remove_circle
SyncAgentPosition
data_object
TargetPosition
data_object
UpdatePosition
data_object
UpdateRotation
data_object
Velocity
data_object
WishVelocity
Methods
functions
CompleteLinkTraversal
functions
GetLookAhead
functions
GetPath
functions
MoveTo
functions
SetAgentPosition
functions
SetPath
functions
Stop
NavMeshAgent
An agent that can navigate the navmesh defined in the scene.
class
Sandbox
.
account_tree
extends
Component
sealed
Sandbox.Engine
build
Constructors
1
NavMeshAgent
(
)
crop_din
Fields
1
CurrentLinkTraversal
Nullable`1
Information about the current link traversal.
data_object
Properties
20
Acceleration
float
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.
AgentPosition
Vector3
Updated with the agent's position, even if UpdatePosition is false
AllowDefaultArea
bool
Is the agent allowed to travel on the default area?
AllowedAreas
HashSet`1
What areas the agent is allowed to travel on. If empty, all areas are allowed.
AutoTraverseLinks
bool
Should the agent automatically traverse links when it reaches them? Or do you want to implement your own link traversal logic?
ForbiddenAreas
HashSet`1
What areas the agent is not allowed to travel on. If empty, no areas are forbidden.
Height
float
IsNavigating
bool
Returns true if the agent is currently navigating to a target.
IsTraversingLink
bool
Returns true if the agent is currently traversing a link.
LinkEnter
Action
Emitted when the agent enters a link.
LinkExit
Action
Emitted when the agent exits a link.
MaxSpeed
float
Radius
float
Separation
float
Gets or sets the separation factor used to control how strongly agents avoid crowding each other.
SyncAgentPosition
obsolete
bool
TargetPosition
Nullable`1
Gets the current target position for the agent, if one is set.
UpdatePosition
bool
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.
UpdateRotation
bool
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.
Velocity
Vector3
WishVelocity
Vector3
The velocity the agent would like to move at, you can pass this into a PlayerController.
functions
Methods
7
CompleteLinkTraversal
(
)
Finish link traversal, must be called after traversing a link if AutoTraverseLinks is false.
GetLookAhead
(
distance
)
Vector3
Get a point on the current path, distance away from here. This is a simplified path so only includes the first few corners.
GetPath
(
)
NavMeshPath
Returns the agent's current path as a NavMeshPath. This is not free, so avoid calling it every frame.
MoveTo
(
targetPosition
)
Navigate to the position
SetAgentPosition
(
position
)
If you want to move the agent from one position to another
SetPath
(
path
)
Assigns a precalculated path for the agent to follow. The agent will attempt to follow the path, but may adjust its movement to avoid obstacles or other agents. If the path becomes invalid during navigation, it may be recalculated completely.
Stop
(
)
Stop moving, or whatever we're doing
Inheritance
Component
NavMeshAgent
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.