Reference API Roblox

Engine API

Website

Related

Reference API Roblox

StarterPlayer

A service which allows the defaults of properties in the Player object to be set.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 46

HistoryMember
726AutoJumpEnabled: bool
726AvatarJointUpgrade: RolloutState
726CameraMaxZoomDistance: float
726CameraMinZoomDistance: float
726CameraMode: CameraMode
726CharacterBreakJointsOnDeath: bool
726CharacterJumpHeight: float
726CharacterJumpPower: float
726CharacterMaxSlopeAngle: float
726CharacterUseJumpPower: bool
726CharacterWalkSpeed: float
726ClassicDeath: bool
726CreateDefaultPlayerModule: bool
726DevCameraOcclusionMode: DevCameraOcclusionMode
726DevComputerCameraMovementMode: DevComputerCameraMovementMode
726DevComputerMovementMode: DevComputerMovementMode
726DevTouchCameraMovementMode: DevTouchCameraMovementMode
726DevTouchMovementMode: DevTouchMovementMode
726EnableDynamicHeads: LoadDynamicHeads
726EnableMouseLockOption: bool
726HealthDisplayDistance: float
726LoadCharacterAppearance: bool
726LoadCharacterLayeredClothing : LoadCharacterLayeredClothing
726LuaCharacterController: CharacterControlMode
726NameDisplayDistance: float
726UserEmotesEnabled: bool
573ClearDefaults(): null
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(className: string): bool
647Changed(property: string)

Removed member index 16

HistoryMember
608AnimationCompositorMode: AnimationCompositorMode
620DeathStyle: DeathStyle
608HumanoidStateMachineMode: HumanoidStateMachineMode
700RagdollDeath: bool
290ScreenOrientation: ScreenOrientation
290ScreenOrientationChanged(newOrientation: ScreenOrientation, fromSensor: bool)

Description

A service which allows the defaults of properties in the Player object to be set. When a player enters the server, each property of the player object is set to the current value of the corresponding property in StarterPlayer.

Additionally, you may add four objects to this service:

  • A StarterPlayerScripts instance with scripts that run once for each player.
  • A StarterCharacterScripts instance with scripts to add to each player's character every time they spawn.
  • A Humanoid instance named StarterHumanoid which will be used as the default humanoid for each player's character.
  • A Model instance named StarterCharacter which will be used as the character model for all players.

History 298

Members 46

AutoJumpEnabled

TypeDefault
bool

This property sets whether the character will automatically jump when hitting an obstacle on a mobile device.

This property is copied from the StarterPlayer to a Player when they join the game. Following that. the value of this property is copied to Humanoid.AutoJumpEnabled property of the character's Humanoid on spawn. In other words, it is possible to set the auto-jump behavior on a per-character, per-player and per-game basis using these three properties.

History 5

AvatarJointUpgrade

TypeDefault
RolloutState

This property controls the rollout state of new AnimationConstraint joints in avatars. When disabled, avatars spawn with legacy Motor6Ds connecting their limbs. When enabled, avatars spawn with AnimationConstraints and BallSocketConstraints connecting their limbs. This makes it easier to write scripts that enable physical simulation, like arm strength and ragdoll falling down.

This property is not replicated. Its interface does not cross the network boundary.

History 12

Tags: [NotReplicated]

CameraMaxZoomDistance

TypeDefault
float

This property sets the maximum distance in studs the camera can be from the character with the default cameras.

This property sets the default value of Player.CameraMaxZoomDistance for each player who joins the game. If this value is set to a lower value than StarterPlayer.CameraMinZoomDistance it will be increased to CameraMinZoomDistance.

History 5

CameraMinZoomDistance

TypeDefault
float

This property sets the minimum distance in studs the camera can be from the character with the default cameras.

This property sets the default value of Player.CameraMinZoomDistance for each player who joins the game. If this value is set to a higher value than StarterPlayer.CameraMaxZoomDistance it will be decreased to CameraMaxZoomDistance.

History 5

CameraMode

TypeDefault
CameraMode

Sets the default value for Player.CameraMode for each player in the game. The camera has two modes:

First Person

In first person mode, the player's camera is zoomed all the way in. Unless there is a visible GUI present with the GuiButton.Modal property set to true, the mouse will be locked and the user's camera will turn as the mouse moves.

Third Person

In third person mode (default), the character can be seen in the camera. While in third person mode on Roblox:

  • You may right-click and drag to rotate your camera, or use the arrow keys at the bottom right-hand corner of the screen.
  • When you move your mouse, your camera does not change (unless you move the mouse to the end of the screen).
  • When you press any of the arrow keys, the user's character will face in the corresponding arrow key's direction.
  • You can zoom in and out freely.

History 5

CharacterBreakJointsOnDeath

TypeDefault
bool

This property determines the starting value of Humanoid.BreakJointsOnDeath for a player's Player.Character.

Note that AvatarJointUpgrade must be enabled for this property to take effect.

History 2

CharacterJumpHeight

TypeDefault
float

This property determines the starting value of Humanoid.JumpHeight for a player's Player.Character in studs, with a default of 7.2.

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

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

History 12

CharacterJumpPower

TypeDefault
float

This property determines the starting value of Humanoid.JumpPower for a player's Player.Character, with a default of 50, minimum of 0, and maximum of 1000.

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

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

History 12

CharacterMaxSlopeAngle

TypeDefault
float

This property determines the starting value of Humanoid.MaxSlopeAngle for a player's Player.Character in degrees. It defaults to 89, so humanoids can climb pretty much any slope they want by default.

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

History 11

CharacterUseJumpPower

TypeDefault
bool

This property determines the starting value of Humanoid.UseJumpPower for a player's Player.Character. Toggling it will change which property is visible in the Properties window (CharacterJumpHeight if false or CharacterJumpPower if true). Defaults to true.

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

History 12

CharacterWalkSpeed

TypeDefault
float

This property determines the starting value of Humanoid.WalkSpeed for a player's Player.Character with a default of 16.

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

History 11

ClassicDeath

TypeDefault
bool

When enabled, the character uses the classic death behavior (joints break apart and parts scatter). When disabled, characters spawn with Humanoid.BreakJointsOnDeath = false, and will ragdoll when they die.

History 3

ClearDefaults

Parameters (0)
No parameters.
Returns (1)
null

History 3

CreateDefaultPlayerModule

TypeDefault
bool

This property is only visible when Workspace.PlayerScriptsUseInputActionSystem is enabled. When set to true (default), the PlayerModule injection point occurs at StarterPlayer. When set to false, the default camera and control scripts will not be added to the place.

This property is not scriptable. It cannot be accessed by script code.

History 2

Tags: [NotScriptable]

DevCameraOcclusionMode

TypeDefault
DevCameraOcclusionMode

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

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

History 5

DevComputerCameraMovementMode

TypeDefault
DevComputerCameraMovementMode

This property lets you overwrite the player's camera mode on a computer.

If set to UserChoice, the player's camera movement mode will be determined by whatever they set in the experience's settings. Otherwise, the mode will be set based on this property.

This property does not affect players who are not on a computer.

History 5

DevComputerMovementMode

TypeDefault
DevComputerMovementMode

This property lets you overwrite the player's movement mode on a computer.

If set to UserChoice, the player's movement mode will be determined by whatever they set in the experience's settings. Otherwise, the mode will be set based on this property.

This property does not affect players who are not on a computer.

History 5

DevTouchCameraMovementMode

TypeDefault
DevTouchCameraMovementMode

This property lets you overwrite the player's camera mode on a touch-enabled device.

If set to UserChoice, the player's camera movement mode will be determined by whatever they set in the experience's settings. Otherwise, the mode will be set based on this property.

This property does not affect players who are not on a touch-enabled device.

History 5

DevTouchMovementMode

TypeDefault
DevTouchMovementMode

Lets you overwrite the player's movement mode on a touch-enabled device.

If set to UserChoice, the player's movement mode will be determined by whatever they set in the experience's settings. Otherwise, the mode will be set based on this property.

This property does not affect players who are not on a touch-enabled device.

History 5

EnableDynamicHeads

TypeDefault
LoadDynamicHeads

Sets the use of dynamic heads. When true, enables the use of avatar heads with facial animation data.

This property is not scriptable. It cannot be accessed by script code.

History 3

Tags: [NotScriptable]

EnableMouseLockOption

TypeDefault
bool

This property determines if a player 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 will move 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 instead to lock the mouse.

History 7

HealthDisplayDistance

TypeDefault
float

This property sets the distance in 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 set to 100 studs by default.

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

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

History 5

LoadCharacterAppearance

TypeDefault
bool

This property sets whether or not the appearance of a player's character should be loaded.

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

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

If Player:LoadCharacterWithHumanoidDescriptionAsync() is used, it can be advantageous to set StarterPlayer.LoadCharacterAppearance to false as the player's avatar is not required as all asset IDs to equip on the character will come from the passed in HumanoidDescription.

History 5

LoadCharacterLayeredClothing

TypeDefault
LoadCharacterLayeredClothing

Indicates whether characters spawning into an experience will have layered clothing accessories equipped on them (Although Workspace.MeshPartHeadsAndAccessories also need to be enabled in the Workspace).

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.

History 3

Tags: [NotReplicated, NotScriptable]

LuaCharacterController

TypeDefault
CharacterControlMode

Determines which character controller implementation drives the player's character movement. Accepts a value from CharacterControlMode: Default, Legacy, NoCharacterController, or LuaCharacterController.

History 3

NameDisplayDistance

TypeDefault
float

Sets the distance at which this player will see other Humanoid names. If set 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, you can set the Player.NameDisplayDistance property.

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

History 5

UserEmotesEnabled

TypeDefault
bool

This property determines if user-owned emotes are loaded when loading avatars. Setting this property to false disables loading. Developers can set the property in Studio directly.

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

See also Avatar Emotes, an article detailing how to control, customize, and play avatar emotes.

History 6

Removed members 16

AnimationCompositorMode

TypeDefault
AnimationCompositorModeDefault
This property is not browsable. It is not visible in Studio's object browser.

History 2

Tags: [NotBrowsable]

DeathStyle

TypeDefault
DeathStyleDefault
This property is not browsable. It is not visible in Studio's object browser.

History 2

Tags: [NotBrowsable]

HumanoidStateMachineMode

TypeDefault
HumanoidStateMachineModeDefault
This property is not browsable. It is not visible in Studio's object browser.

History 3

Tags: [NotBrowsable]

RagdollDeath

TypeDefault
booltrue
This property is not browsable. It is not visible in Studio's object browser.

History 2

Tags: [NotBrowsable]

ScreenOrientation

TypeDefault
ScreenOrientation

History 4

ScreenOrientationChanged

Parameters (2)
newOrientationScreenOrientation
fromSensorbool

History 4

Settings