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

DevTouchMovementMode

StarterPlayer

DevTouchMovementMode

The DevTouchMovementMode StarterPlayer property lets the developer overwrite the player’s movement mode if the player is on a touch device.

This is the default property for players joining the game. It can be changed for individual players by settings the Player/DevTouchMovementMode.

If set to UserChoice then the player’s movement mode will be determined by whatever the player set in the game settings. Otherwise, the mode will be set based on this property.

See Enum/DevTouchMovementMode for the different movement modes available. Lets developer overwrite the player’s movement mode if the player is on a touch device.

Note

This property has no affect on players not on a touch enabled device.


Code Samples


Setting a Player's Movement Mode (Touch)

The example demonstrates how to set the movement mode for players on touch enabled devices.

In this example, we set the movement mode to Thumbstick via the Enum/DevTouchMovementMode enum. This means that players on touch enabled devices be able to move via a virtual thumbstick on their screen.

local player = game.Players.LocalPlayer

-- Set the player's movement mode on mobile devices to a virtual thumbstick
player.DevTouchMovementMode = Enum.DevTouchMovementMode.Thumbstick