Glorpia Docs
Scripting / Humanoid

Humanoid:MoveTo()

Moves an authored NPC character Model toward a world-space position.

Signature

humanoid:MoveTo(position)

Parameters

NameTypeDescription
positionVector3World-space destination for the NPC character.

Behavior

MoveTo() is an authoritative server operation. It is available to public ServerScript code and is rejected from public LocalScript code.

The Humanoid must be a direct child of a valid R6-style character Model containing Head, Torso, both arms and both legs. Movement uses the Humanoid's WalkSpeed.

NPC movement uses character-style gravity and animation. The body faces its horizontal travel direction, the R6 walk cycle plays while moving, and an unsupported NPC falls until it reaches collidable ground.

Movement heads directly toward the requested X/Z position and stops at collidable geometry. This is not a pathfinding API. Calling MoveTo() also cancels an active FollowPlayer() target.

Example

Luau
local npc = workspace:WaitForChild("Guide")
local humanoid = npc:WaitForChild("Humanoid")

humanoid:MoveTo(Vector3.new(32, 0, 16))

Related