PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
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.