s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejams
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
Get s&box
Sign in with Steam
Api
Classes
MoveToTask
chevron_left Classes
class
MoveToTask

Constructors

functionsMoveToTask

Properties

data_objectFaceTargetdata_objectSpeeddata_objectStopDistancedata_objectTargetObjectdata_objectTargetPosition

Methods

lockOnEndlockOnStartlockOnUpdate
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.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter