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
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
Get s&box
Sign in with Steam
Api
Classes
MoveToTask
chevron_left
Classes
class
MoveToTask
Constructors
functions
MoveToTask
Properties
data_object
FaceTarget
data_object
Speed
data_object
StopDistance
data_object
TargetObject
data_object
TargetPosition
Methods
lock
OnEnd
lock
OnStart
lock
OnUpdate
MoveToTask
Commands the NPC's movement layer to a position or GameObject, periodically updating a moving target's path. Leaves the look target unchanged; the movement layer controls facing.
class
Sandbox.Npcs.Tasks
.
account_tree
extends
BaseTask
Sandbox.Engine
build
Constructors
1
MoveToTask
(
targetPosition
,
stopDistance
)
data_object
Properties
5
FaceTarget
GameObject
Keep facing this object while moving instead of turning into the movement direction. The NPC backpedals or strafes -- short moves away from someone happen without turning our back on them.
Speed
Nullable`1
Movement speed for this task. Null uses the NPC's configured speed.
StopDistance
float
How close to the target counts as arrived.
TargetObject
GameObject
The object to move to, followed as it moves, when the task was given one.
TargetPosition
Nullable`1
The point to move to, when the task was given a position.
functions
Methods
3
OnEnd
(
)
OnStart
(
)
OnUpdate
(
)
TaskResult
Inheritance
BaseTask
MoveToTask
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.