PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Move

The Move Player function causes the player’s character to walk in the given direction until stopped, or interrupted by the player (by using their controls).

This is useful when scripting NPC Humanoids that move around a map - but are not controlled by an actual player’s input.

Note that the function’s second argument indicates whether the provided DataType/Vector3 should move the player relative to world coordinates (false) or the player’s Camera (true).

Parameters

Name Type Default Description

The Vector3 direction that the player should move.

false

A boolean indicating whether the player should move relative to the player’s camera.

Returns

Return Type Summary

No return.


Code Samples


Moving the Player Towards Their Camera

The following example would cause the LocalPlayer to walk forward, towards where their camera is pointing.

game.Players.LocalPlayer:Move(Vector3.new(0, 0, -1), true)