s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
input
Log in with Steam
Api
Components
NavMeshAgent
chevron_left
Components
class
NavMeshAgent
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
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
The current simulated position, including when 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
IsTraversingLink
bool
LinkEnter
Action
LinkExit
Action
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
The requested target, or null when stopped.
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
functions
Methods
7
CompleteLinkTraversal
(
)
Ends custom link traversal at the current AgentPosition and resumes navigation.
GetLookAhead
(
distance
)
Vector3
GetPath
(
)
NavMeshPath
MoveTo
(
targetPosition
)
SetAgentPosition
(
position
)
Explicitly repositions the simulated agent. Runtime GameObject transforms do not move it.
SetPath
(
path
)
Assigns a path calculated on this navmesh. The start must project onto the path's first polygon.
Stop
(
)
Inheritance
Component
NavMeshAgent
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.