StarterPlayer | Documentation - Roblox Creator Hub (2024)

AllowCustomAnimations

bool

hidden

read parallel

roblox script security

The AllowCustomAnimations StarterPlayer property describes thecurrent game's permission levels regarding custom avatarAnimations from the website.

As such, this value cannot be changed from within the game. It can only bechanged by changing the game's permission levels within the game'ssetting's page on the website.

This property is not intended for use in the game.

AutoJumpEnabled

bool

read parallel

The AutoJumpEnabled property sets whether the character will automaticallyjump when hitting an obstacle on a mobile device.

This property is copied from the StarterPlayer to a Playerwhen they join the game. Following that. the value of this property iscopied to Humanoid.AutoJumpEnabled property of the character'sHumanoid on spawn. In other words, it is possible to set theauto-jump behavior on a per-character, per-player and per-game basis usingthese three properties.

Code Samples

Auto-Jump Toggle

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local button = script.Parent

local function update()

-- Update button text

if player.AutoJumpEnabled then

button.Text = "Auto-Jump is ON"

else

button.Text = "Auto-Jump is OFF"

end

-- Reflect the property in the player's character, if they have one

if player.Character then

local human = player.Character:FindFirstChild("Humanoid")

if human then

human.AutoJumpEnabled = player.AutoJumpEnabled

end

end

end

local function onActivated()

-- Toggle auto-jump

player.AutoJumpEnabled = not player.AutoJumpEnabled

-- Update everything else

update()

end

button.Activated:Connect(onActivated)

update()

AvatarJointUpgrade

Enum.AvatarJointUpgrade

not replicated

not browsable

read parallel

CameraMaxZoomDistance

number

read parallel

The CameraMaxZoomDistance StarterPlayer property sets the maximumdistance in studs the camera can be from the character with the defaultcameras.

This property sets the default value ofPlayer.CameraMaxZoomDistance for each player who joins the game.If this value is set to a lower value thanStarterPlayer.CameraMinZoomDistance it will be increased toCameraMinZoomDistance.

Code Samples

Setting Camera Zoom Distance

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.CameraMaxZoomDistance = 50

player.CameraMinZoomDistance = 75

CameraMinZoomDistance

number

read parallel

The CameraMinZoonDistance StarterPlayer property sets the minimumdistance in studs the camera can be from the character with the defaultcameras.

This property sets the default value ofPlayer.CameraMinZoomDistance for each player who joins the game.If this value is set to a higher value thanStarterPlayer.CameraMaxZoomDistance it will be decreased toCameraMaxZoomDistance.

Code Samples

Setting Camera Zoom Distance

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.CameraMaxZoomDistance = 50

player.CameraMinZoomDistance = 75

CameraMode

Enum.CameraMode

read parallel

The CameraMode StarterPlayer property sets whether cameras will belocked to first person or not when a player joins the game.

Sets the default value for Player.CameraMode for each player inthe game.

The camera has two modes:

  1. First person

  2. Third person

The Enum.CameraMode Enum is used to set CameraMode, and determines whenfirst and third person cameras should be used.

First-person

In first-person mode, the player's camera is zoomed all the way in. Unlessthere is a visible GUI present with the GuiButton.Modal propertyset to true, the mouse will be locked and the user's camera will turn asthe mouse moves.

Third-person

In third-person mode, the character can be seen in the camera. While inthird-person mode on Roblox:

  • You may right-click and drag to rotate your camera, or use the arrowkeys at the bottom right-hand corner of the screen.

  • When you move your mouse, your camera does not change (unless you movethe mouse to the end of the screen).

  • When you press any of the arrow keys, the user's character will face inthe corresponding arrow key's direction.

  • You can zoom in and out freely.

Third-person is the default camera setting.

Code Samples

Playing in First Person

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.CameraMode = Enum.CameraMode.LockFirstPerson

CharacterJumpHeight

number

read parallel

CharacterJumpHeight determines the starting value ofHumanoid.JumpHeight for a player'sCharacter. The value of this property defaults to7.2 studs.

This property is only visible in the Properties window IfStarterPlayer.CharacterUseJumpPower is set to false, as itwould not be relevant otherwise.

Since this property is only relevant for characters being spawned in thefuture, changing it will not change any existing player characters.Changes to this property will only take effect when a player respawns.

CharacterJumpPower

number

read parallel

CharacterJumpPower determines the starting value ofHumanoid.JumpPower for a player'sCharacter. The value of this property defaults to50 and when applied to the player's Humanoid it will beconstrained between 0 and 1000.

This property is only visible in the Properties window IfStarterPlayer.CharacterUseJumpPower is set to true, as itwould not be relevant otherwise.

Since this property is only relevant for characters being spawned in thefuture, changing it will not change any existing player characters.Changes to this property will only take effect when a player respawns.

CharacterMaxSlopeAngle

number

read parallel

CharacterMaxSlopeAngle determines the starting value ofHumanoid.MaxSlopeAngle for a player'sCharacter. It defaults to 89°, so humanoids canclimb pretty much any slope they want by default. When applied to theplayer's Humanoid it will be constrained between 0 and 89.

Since this property is only relevant for characters being spawned in thefuture, changing it will not change any existing player characters.Changes to this property will only take effect when a player respawns.

CharacterUseJumpPower

bool

read parallel

CharacterUseJumpPower determines the starting value ofHumanoid.UseJumpPower for a player'sCharacter. Toggling it will change which propertyis visible in the properties window:CharacterJumpHeight (false) orStarterPlayer.CharacterJumpPower (true). Defaults to true.

Since this property is only relevant for characters being spawned in thefuture, changing it will not change any existing player characters.Changes to this property will only take effect when a player respawns.

CharacterWalkSpeed

number

read parallel

CharacterWalkSpeed determines the starting value ofHumanoid.WalkSpeed for a player'sCharacter. This property defaults to 16.

Since this property is only relevant for characters being spawned in thefuture, changing it will not change any existing player characters.Changes to this property will only take effect when a player respawns.

DevCameraOcclusionMode

Enum.DevCameraOcclusionMode

read parallel

Defines how the default camera scripts handle objects between the cameraand the camera subject. Applies to all players as they join the experienceand can't be changed for individual players.

The default value is Zoom (0). SeeEnum.DevCameraOcclusionMode for a list of available modes.

DevComputerCameraMovementMode

Enum.DevComputerCameraMovementMode

read parallel

The DevComputerCameraMovementMode StarterPlayer property lets thedeveloper overwrite the player's camera mode if the player is on acomputer.

This is the default property for players joining the game. It can bechanged for individual players by settings thePlayer.DevComputerCameraMode.

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

See Enum.DevComputerCameraMovementMode for the different camera modesavailable.

This property has no affect on players not on a computer.

Code Samples

Setting a Player's Camera Movement Mode (Desktop)

local Players = game:GetService("Players")

local player = Players.LocalPlayer

-- Set the player's camera movement mode on computers to classic

player.DevComputerCameraMode = Enum.DevComputerCameraMovementMode.Classic

DevComputerMovementMode

Enum.DevComputerMovementMode

read parallel

The DevComputerMovementMove StarterPlayer property lets thedeveloper overwrite the player's movement mode if the player is on acomputer.

This is the default property for players joining the game. It can bechanged for individual players by settings thePlayer.DevComputerMovementMode.

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

See Enum.DevComputerMovementMode for the different movement modesavailable. Lets developer overwrite the player's movement mode if theplayer is on a computer.

This property has no affect on players not on a computer.

Code Samples

Setting a Player's Movement Mode (Desktop)

local Players = game:GetService("Players")

game.Players.PlayerAdded:Connect(function(player)

-- Set the player's movement mode on mobile devices to a dynamic thumbstick

player.DevComputerMovementMode = Enum.DevComputerMovementMode.DynamicThumbstick

end)

DevTouchCameraMovementMode

Enum.DevTouchCameraMovementMode

read parallel

The DevTouchCameraMovementMode StarterPlayer property lets thedeveloper overwrite the player's camera mode if the player is on a touchdevice.

This is the default property for players joining the game. It can bechanged for individual players by settings thePlayer.DevTouchCameraMode.

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

See Enum.DevTouchCameraMovementMode for the different camera modesavailable.

This property has no affect players not on a mobile device.

Code Samples

Setting a Player's Camera Movement Mode (Touch)

local Players = game:GetService("Players")

local player = Players.LocalPlayer

-- Set the player's camera movement mode on mobile devices to classic

player.DevTouchCameraMovementMode = Enum.DevTouchCameraMovementMode.Classic

DevTouchMovementMode

Enum.DevTouchMovementMode

read parallel

The DevTouchMovementMode StarterPlayer property lets the developeroverwrite 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 bechanged for individual players by settings thePlayer.DevTouchMovementMode.

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

See Enum.DevTouchMovementMode for the different movement modesavailable. Lets developer overwrite the player's movement mode if theplayer is on a touch device.

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

Code Samples

Setting a Player's Movement Mode (Touch)

local Players = game:GetService("Players")

game.Players.PlayerAdded:Connect(function(player)

-- Set the player's movement mode on mobile devices to a dynamic thumbstick

player.DevTouchMovementMode = Enum.DevTouchMovementMode.DynamicThumbstick

end)

EnableDynamicHeads

Enum.LoadDynamicHeads

not scriptable

read parallel

EnableMouseLockOption

bool

read parallel

The EnableMouseLockOption StarterPlayer property determines if aplayer can toggle mouse lock by default.

Mouselock will lock the player's cursor to the center of the screen.Moving the mouse will rotate the Camera and Player willmove relative to the current rotation of the camera.

This property sets the value of Player.DevEnableMouseLock.

Note that shift-lock related APIs are in the process of being deprecated,so it's recommended to use UserInputService.MouseBehavior insteadto lock the mouse.

Code Samples

Enabling a Player's Mouse Lock

local Players = game:GetService("Players")

local player = Players.LocalPlayer

while true do

player.DevEnableMouseLock = not player.DevEnableMouseLock

task.wait(5)

end

HealthDisplayDistance

number

read parallel

The HealthDisplayDistance StarterPlayer property sets the distancein studs at which this player will see other Humanoid health bars.If set to 0, the health bars will not be displayed. This property is setto 100 studs by default.

To change the display distance for a player once they join the game, youcan set the Player.HealthDisplayDistance property.

If a Humanoid health bar is visible, you can set the display typeusing Humanoid.DisplayDistanceType.

Code Samples

Hiding Player Health and Names

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.HealthDisplayDistance = 0

player.NameDisplayDistance = 0

LoadCharacterAppearance

bool

read parallel

The LoadCharacterAppearance StarterPlayer property sets whether ornot the appearance of a player's character should be loaded.

Setting this to false results in the player having no clothes (includinghats), body colors, body packages or anything else related to theappearance of the player's avatar. By default, this property is set totrue.

Setting this to true results in the player loading the appearancecorresponding to the player's Player.CharacterAppearanceId.

If Player:LoadCharacterWithHumanoidDescription() is used, it canbe advantageous to set StarterPlayer.LoadCharacterAppearance tofalse as the player's avatar is not required as all asset IDs to equip onthe character will come from the passed in HumanoidDescription.

Code Samples

Disabling a Player's Appearance

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.CanLoadCharacterAppearance = false

LoadCharacterLayeredClothing

Enum.LoadCharacterLayeredClothing

not replicated

not scriptable

read parallel

Indicates whether characters spawning into an experience will have layeredclothing accessories equipped on them (AlthoughWorkspace.MeshPartHeadsAndAccessories also need to be enabled inthe Workspace).

LuaCharacterController

Enum.CharacterControlMode

not browsable

read parallel

NameDisplayDistance

number

read parallel

Sets the distance at which this player will see other Humanoidnames. If set to 0, names are hidden.

The NameDisplayDistance StarterPlayer property sets the distancein studs at which this player will see other Humanoid names. Ifset to 0, names are hidden. This property is set to 100 studs by default.

To change the display distance for a player once they join the game, youcan set the Player.NameDisplayDistance property.

If a Humanoid name is visible, you can set the display type usingHumanoid.DisplayDistanceType.

Code Samples

Hiding Player Health and Names

local Players = game:GetService("Players")

local player = Players.LocalPlayer

player.HealthDisplayDistance = 0

player.NameDisplayDistance = 0

UserEmotesEnabled

bool

read parallel

This property determines if user-owned emotes are loaded when loadingavatars. Setting this property to false disables loading. Developers canset the property in Studio directly or through theGame Settings menu.

When emote loading is disabled, the emotes UI will still work as long asdevelopers choose to use the emotes feature by adding emotes within theirgame.

See also:

  • Avatar Emotes, an article detailing howto control, customize, and play avatar emotes

StarterPlayer | Documentation - Roblox Creator Hub (2024)
Top Articles
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6076

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.