속성의 기본값을 Player 개체에서 설정할 수 있는 서비스.플레이어가 서버에 들어가면 플레이어 개체의 각 속성이 StarterPlayer 에서 해당 속성의 현재 값으로 설정됩니다.
또한 이 서비스에 네 개의 개체를 추가할 수 있습니다.
- 각 플레이어에 한 번만 실행되는 스크립트가 있는 StarterPlayerScripts 인스턴스.
- 스크립트를 추가하여 각 플레이어의 캐릭터를 매번 생성할 때마다 업데이트하는 StarterCharacterScripts 인스턴스.
- 각 플레이어의 캐릭터에 대한 기본 휴머드로 사용될 Humanoid 인스턴스 이름이 StarterHumanoid 인 것.
- 모든 플레이어의 캐릭터 모델로 사용될 인스턴스 이름 Class.Model``StarterCharacter
요약
속성
웹사이트에서 사용자 지정 아바타 애니메이션에 대한 현재 게임의 권한 레벨을 설명합니다.
모바일 기기장애물을 치면 캐릭터가 자동으로 점프하는지 여부를 설정합니다.
플레이어의 기본 카메라가 스터드 단위로 확대할 수 있는 최대 거리.
플레이어의 기본 카메라가 확대할 수 있는 최소 거리(스터드)입니다.
기본 카메라의 모드를 첫 번째 또는 세 번째 사람으로 변경합니다.
Humanoid.JumpHeight의 시작 값을 결정하여 Player.Character에 대한 값을 생성합니다.
Humanoid.JumpPower의 시작 값을 결정하여 Player.Character에 대한 값을 생성합니다.
Humanoid.MaxSlopeAngle의 시작 값을 결정하여 Player.Character에 대한 값을 생성합니다.
Humanoid.UseJumpPower 의 시작 상태를 결정합니다 Player.Character 에 대해.
Humanoid.WalkSpeed의 시작 값을 결정하여 Player.Character에 대한 값을 생성합니다.
기본 카메라가 카메라와 플레이어 사이의 개체를 처리하는 방법을 설정합니다.
플레이어가 컴퓨터에 있으면 개발자가 각 플레이어의 기본 카메라 모드를 재정의할 수 있습니다.
플레이어가 컴퓨터에 있는 경우 개발자가 플레이어의 이동 모드를 덮어쓰도록 합니다.
플레이어가 모바일 기기있으면 개발자가 각 플레이어에 대한 기본 카메라 이동 모드를 재정의할 수 있습니다.
플레이어가 터치 기기있으면 개발자가 플레이어의 이동 모드를 덮어쓸 수 있습니다.
플레이어가 기본적으로 마우스 잠금을 전환할 수 있는지 여부를 결정합니다.
이 플레이어가 다른 Humanoid 건강 바를 볼 수 있는 거리를 설정합니다. 0으로 설정하면 건강 바가 표시되지 않습니다.
플레이어의 캐릭터 모양이 로드되는지 여부.
경험에 생성되는 캐릭터에 층 옷 액세서리가 장착될지 여부를 나타냅니다.
이 플레이어가 다른 Humanoid 이름을 볼 수 있는 거리를 설정합니다.
아바타를 로드할 때 사용자 소유 이모트가 로드되는지 여부를 결정합니다.
속성
AllowCustomAnimations
이 속성은 웹사이트에서 사용자 지정 아바타에 대한 현재 게임의 권한 레벨을 설명합니다. Animations
따라서 이 값은 게임 내에서 변경할 수 없습니다.웹사이트의 설정 페이지에서 게임의 권한 수준을 변경하여 변경할 수 있습니다. It can only be changed by changing the game's permission levels within the game's setting's page on the website.
이 속성은 게임에서 사용되지 않습니다.
AutoJumpEnabled
이 속성은 모바일 기기장애물을 치면 캐릭터가 자동으로 점프하는지 여부를 설정합니다.
이 속성은 게임에 참여할 때 StarterPlayer에서 Player로 복사됩니다.그 후에.이 속성의 값은 생성 시 Humanoid.AutoJumpEnabled 캐릭터의 Humanoid 속성에 복사됩니다.즉, 이 세 가지 속성을 사용하여 문자당, 플레이어당 및 게임당 자동 점프 동작을 설정할 수 있습니다.
코드 샘플
이 코드 샘플은 TextButton을 위한 것입니다. 모바일 장치에서 플레이어가 자동 점프 동작을 전환할 수 있도록 합니다.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local button = script.Parent
local function update()
-- 업데이트 버튼 텍스트 변경
if player.AutoJumpEnabled then
button.Text = "Auto-Jump is ON"
else
button.Text = "Auto-Jump is OFF"
end
-- 플레이어의 캐릭터에 속성을 반영하세요, 있는 경우
if player.Character then
local human = player.Character:FindFirstChild("Humanoid")
if human then
human.AutoJumpEnabled = player.AutoJumpEnabled
end
end
end
local function onActivated()
-- 자동 점프 전환
player.AutoJumpEnabled = not player.AutoJumpEnabled
-- 다른 모든 것 업데이트
update()
end
button.Activated:Connect(onActivated)
update()
AvatarJointUpgrade
CameraMaxZoomDistance
이 속성은 기본 카메라로 캐릭터에서 카메라까지의 최대 거리를 스터드로 설정합니다.
이 속성은 게임에 참여하는 각 플레이어에 대한 기본값 Player.CameraMaxZoomDistance를 설정합니다.이 값이 StarterPlayer.CameraMinZoomDistance 보다 낮은 값으로 설정되면 CameraMinZoomDistance로 증가합니다.
코드 샘플
The example demonstrates how to set a player's camera minimum and maximum zoom distance.
In this example, we set the Player.CameraMinZoomDistance and Player.CameraMaxZoomDistance to set the min and max distance in studs a player's camera can be from their character.
Note that since the example attempts to set the CameraMinZoomDistance to be greater than the CameraMaxZoomDistance, the CameraMinZoomDistance value will be decreased and set to the value of the max zoom distance.
To change the default min and max zoom distance values for a player when they first enter the game, you can change the StarterClass.Player.CameraMinZoomDistance and StarterClass.Player.CameraMaxZoomDistance properties.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 75
CameraMinZoomDistance
이 속성은 카메라가 기본 카메라와 함께 캐릭터에서 최소 거리를 스터드로 설정합니다.
이 속성은 게임에 참여하는 각 플레이어에 대한 기본값 Player.CameraMinZoomDistance를 설정합니다.이 값이 StarterPlayer.CameraMaxZoomDistance보다 높은 값으로 설정되면 CameraMaxZoomDistance로 줄어듭니다.
코드 샘플
The example demonstrates how to set a player's camera minimum and maximum zoom distance.
In this example, we set the Player.CameraMinZoomDistance and Player.CameraMaxZoomDistance to set the min and max distance in studs a player's camera can be from their character.
Note that since the example attempts to set the CameraMinZoomDistance to be greater than the CameraMaxZoomDistance, the CameraMinZoomDistance value will be decreased and set to the value of the max zoom distance.
To change the default min and max zoom distance values for a player when they first enter the game, you can change the StarterClass.Player.CameraMinZoomDistance and StarterClass.Player.CameraMaxZoomDistance properties.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 75
CameraMode
게임의 각 플레이어에 대한 기본값을 Player.CameraMode로 설정합니다. 카메라에는 두 가지 모드가 있습니다.
첫 번째 사람
1인칭 모드에서 플레이어의 카메라가 전체 확장됩니다. 속성이 로 설정되어 표시되는 GUI가 없으면 마우스가 잠겨 사용자의 카메라가 마우스가 이동하는 대로 전환됩니다.
세 번째 사람
세 번째 사람 모드(기본값)에서 캐릭터는 카메라에서 볼 수 있습니다. Roblox에서 세 번째 사람 모드 중:
- 마우스 오른쪽 버튼을 클릭하고 드래그하여 카메라를 회전시키거나 화면 오른쪽 하단의 화살표 키를 사용할 수 있습니다.
- 마우스를 이동하면 카메라가 변경되지 않습니다(마우스를 화면 끝으로 이동하지 않는 한).
- 화살표 키 중 하나를 누르면 사용자의 캐릭터가 해당 화살표 키의 방향으로 향합니다.
- 자유롭게 확대하고 축소할 수 있습니다.
코드 샘플
This example demonstrates how to change the character's CameraMode to first person using the LockFirstPerson value of the Enum.CameraMode enum.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
CharacterJumpHeight
이 속성은 플레이어의 Player.Character에 대한 시작 값을 Humanoid.JumpHeight로 결정합니다. 이 속성의 값은 7.2스터드로 기본값입니다.
이 속성은 다른 경우 관련이 없으므로 속성 창에만 표시되며 로 설정되면 표시되지 않습니다.
이 속성은 미래에 생성되는 캐릭터에만 관련되므로, 변경하면 기존 플레이어 캐릭터가 변경되지 않습니다.이 속성의 변경은 플레이어가 재생성될 때만 적용됩니다.
CharacterJumpPower
이 속성은 플레이어의 Player.Character에 대한 시작 값을 Humanoid.JumpPower로 결정합니다.이 속성의 값은 50으로 기본 설정되며, 플레이어의 Humanoid에 적용되면 0과 1000 사이에서 제한됩니다.
이 속성은 다른 경우 관련이 없으므로 속성 창에만 표시되며 로 설정되면 표시되지 않습니다.
이 속성은 미래에 생성되는 캐릭터에만 관련되므로, 변경하면 기존 플레이어 캐릭터가 변경되지 않습니다.이 속성의 변경은 플레이어가 재생성될 때만 적용됩니다.
CharacterMaxSlopeAngle
이 속성은 플레이어의 Player.Character에 대한 시작 값을 Humanoid.MaxSlopeAngle로 결정합니다.기본값은 89°이므로 인간형은 기본적으로 원하는 경사면을 오를 수 있습니다.플레이어의 Humanoid에 적용되면 0과 89 사이에서 제한됩니다.
이 속성은 미래에 생성되는 캐릭터에만 관련되므로, 변경하면 기존 플레이어 캐릭터가 변경되지 않습니다.이 속성의 변경은 플레이어가 재생성될 때만 적용됩니다.
CharacterUseJumpPower
는 플레이어의 에 대한 시작 값을 결정합니다.전환하면 속성 창에 표시되는 속성이 변경됩니다: CharacterJumpHeight (거짓) 또는 StarterPlayer.CharacterJumpPower (참).기본값은 true입니다.
이 속성은 미래에 생성되는 캐릭터에만 관련되므로, 변경하면 기존 플레이어 캐릭터가 변경되지 않습니다.이 속성의 변경은 플레이어가 재생성될 때만 적용됩니다.
CharacterWalkSpeed
이 속성은 플레이어의 Player.Character에 대한 시작 값을 Humanoid.WalkSpeed로 결정합니다. 이 속성은 기본값으로 16을 사용합니다.
이 속성은 미래에 생성되는 캐릭터에만 관련되므로, 변경하면 기존 플레이어 캐릭터가 변경되지 않습니다.이 속성의 변경은 플레이어가 재생성될 때만 적용됩니다.
ClassicDeath
DevCameraOcclusionMode
기본 카메라 스크립트가 카메라와 카메라 주제 사이의 개체를 처리하는 방법을 정의합니다.모든 플레이어가 경험에 참여할 때 적용되며 개별 플레이어에 대해 변경할 수 없습니다.
기본값은 Zoom (0)입니다. 사용 가능한 모드 목록은 Enum.DevCameraOcclusionMode에 참조하십시오.
DevComputerCameraMovementMode
이 속성은 플레이어가 컴퓨터에 있는 경우 개발자가 플레이어의 카메라 모드를 덮어쓸 수 있게 합니다.
이것은 게임에 참여하는 플레이어의 기본 속성입니다. 개별 플레이어를 위해 Player.DevComputerCameraMode를 설정하여 변경할 수 있습니다.
UserChoice로 설정하면 플레이어의 카메라 이동 모드는 게임 설정에서 플레이어가 설정한 것에 따라 결정됩니다.그렇지 않으면 모드는 이 속성에 따라 설정됩니다.
사용 가능한 다양한 카메라 모드는 Enum.DevComputerCameraMovementMode에 참조하십시오.
이 속성은 컴퓨터에 없는 플레이어에 영향을 주지 않습니다.
코드 샘플
The example demonstrates how to set a player's camera movement mode for players on a computer.
In this example, we set the camera movement mode to Classic via the Enum.DevComputerCameraMovementMode enum. This means that the camera of players on touch enabled devices will track the player but will not automatically rotate if the player walks left or right.
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
이 속성은 플레이어가 컴퓨터에 있는 경우 개발자가 플레이어의 이동 모드를 덮어쓸 수 있도록 합니다.
이것은 게임에 참여하는 플레이어의 기본 속성입니다. 개별 플레이어를 위해 Player.DevComputerMovementMode를 설정하여 변경할 수 있습니다.
UserChoice로 설정하면 플레이어의 이동 모드는 게임 설정에서 플레이어가 설정한 것에 따라 결정됩니다.그렇지 않으면 모드는 이 속성에 따라 설정됩니다.
사용 가능한 다양한 이동 모드는 Enum.DevComputerMovementMode에 참조하십시오. 플레이어가 컴퓨터에 있는 경우 개발자가 플레이어의 이동 모드를 덮어쓰도록 합니다.
이 속성은 컴퓨터에 없는 플레이어에 영향을 주지 않습니다.
코드 샘플
Demonstrates how to set the movement mode for players on computers using the Player.DevComputerMovementMode property.
local Players = game:GetService("Players")
local function onPlayerAdded(player: Player)
-- Set the player's movement mode on desktop devices to click-to-move
-- Once set, the player can right click in the game world and the character will move there.
player.DevComputerMovementMode = Enum.DevComputerMovementMode.ClickToMove
end
Players.PlayerAdded:Connect(onPlayerAdded)
DevTouchCameraMovementMode
이 속성을 사용하면 플레이어가 터치 기기있는 경우 개발자가 플레이어의 카메라 모드를 재정의할 수 있습니다.
이것은 게임에 참여하는 플레이어의 기본 속성입니다. 개별 플레이어를 위해 Player.DevTouchCameraMode를 설정하여 변경할 수 있습니다.
UserChoice로 설정하면 플레이어의 카메라 이동 모드는 게임 설정에서 플레이어가 설정한 것에 따라 결정됩니다.그렇지 않으면 모드는 이 속성에 따라 설정됩니다.
사용 가능한 다양한 카메라 모드는 Enum.DevTouchCameraMovementMode에 참조하십시오.
이 속성은 모바일 기기없는 플레이어에 영향을 주지 않습니다.
코드 샘플
The example demonstrates how to set a player's camera movement mode.
In this example, we set the camera movement mode to Classic via the Enum.DevTouchCameraMovementMode enum. This means that the camera of players on touch enabled devices will track the player but will not automatically rotate if the player walks left or right.
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
이 속성을 사용하면 플레이어가 터치 기기있는 경우 개발자가 플레이어의 이동 모드를 재정의할 수 있습니다.
이것은 게임에 참여하는 플레이어의 기본 속성입니다. 개별 플레이어를 위해 Player.DevTouchMovementMode를 설정하여 변경할 수 있습니다.
UserChoice로 설정하면 플레이어의 이동 모드는 게임 설정에서 플레이어가 설정한 것에 따라 결정됩니다.그렇지 않으면 모드는 이 속성에 따라 설정됩니다.
사용 가능한 다양한 이동 모드는 Enum.DevTouchMovementMode 를 참조하십시오. 플레이어가 터치 기기있는 경우 개발자가 플레이어의 이동 모드를 덮어쓰도록 합니다.
이 속성은 터치 활성화된 기기없는 플레이어에 영향을 주지 않습니다.
코드 샘플
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 are able to move via a virtual thumbstick on their screen.
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
EnableMouseLockOption
이 속성은 플레이어가 기본적으로 마우스 잠금을 전환할 수 있는지 여부를 결정합니다.
마우스 잠금은 플레이어의 커서를 화면 중앙에 고정합니다.마우스를 이동하면 Camera 및 Player 가 회전되고 카메라의 현재 회전에 비례해 이동됩니다.
이 속성은 Player.DevEnableMouseLock의 값을 설정합니다.
쉬프트락 관련 API가 사라지는 과정에 있으므로 마우스를 잠그기 위해 UserInputService.MouseBehavior 대신 사용하는 것이 좋습니다.
코드 샘플
The example demonstrates how to enable and disabled whether a player can lock their mouse.
In this example, we set the use a while true loop to toggle the state of the DevEnabledMouseLock property between true and false every 5 seconds. While this example has little practical use, it demos how to change the property via a LocalScript.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
while true do
player.DevEnableMouseLock = not player.DevEnableMouseLock
task.wait(5)
end
HealthDisplayDistance
이 속성은 이 플레이어가 다른 Humanoid 건강 바를 볼 수 있는 스터드 거리를 설정합니다.0으로 설정하면 상태 바가 표시되지 않습니다.이 속성은 기본적으로 100스터드로 설정됩니다.
플레이어가 게임에 참여하면 표시 거리를 변경하려면 Player.HealthDisplayDistance 속성을 설정할 수 있습니다.
Humanoid 체력 바가 표시되는 경우 Humanoid.DisplayDistanceType를 사용하여 표시 유형을 설정할 수 있습니다.
코드 샘플
This example demonstrates how to hide other Humanoid's (Player and NPC) health bars and names.
This is done by setting the player's Player.HealthDisplayDistance and Player.NameDisplayDistance properties to 0.
If you would like to display health bars and names, you set the properties to a value greater than 0. For instance, setting the properties to 100 means that the player will see other player's health and names up to 100 studs away.
To modify the default values for players, you can change the values of the StarterClass.Player.HealthDisplayDistance and StarterClass.Player.NameDisplayDistance properties.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.HealthDisplayDistance = 0
player.NameDisplayDistance = 0
LoadCharacterAppearance
이 속성은 플레이어의 캐릭터의 모양이 로드되는지 여부를 설정합니다.
이것을 false로 설정하면 플레이어에게 옷(모자 포함), 신체 색상, 신체 패키지 또는 플레이어 아바타의 모양과 관련된 다른 것들이 없어집니다.기본적으로 이 속성은 true로 설정됩니다.
이를 true로 설정하면 플레이어가 플레이어의 Player.CharacterAppearanceId에 해당하는 모양을 로드하게 됩니다.
Player:LoadCharacterWithHumanoidDescription() 가 사용되면 플레이어의 아바타가 필요하지 않기 때문에 StarterPlayer.LoadCharacterAppearance 를 false로 설정하면 모든 자산 ID를 장착하기 위해 전송된 HumanoidDescription 에서 올 수 있어 장점이 있습니다.
코드 샘플
This example demonstrates how to disable loading a player's character appearance. Instead, the player loads as a grey model without any hats, shirts, pants, etc.
This is useful for games using custom clothing and accessories.
Note that if the character has already spawned, this change will not take affect until the player respawns or the Player:LoadCharacter() function is called.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CanLoadCharacterAppearance = false
LoadCharacterLayeredClothing
경험에 생성되는 캐릭터에 층이 있는 의류 액세서리가 장착될지 여부를 나타냅니다(그러나 에도 활성화해야 합니다).
LuaCharacterController
NameDisplayDistance
이 플레이어가 다른 Humanoid 이름을 볼 수 있는 거리를 설정합니다.0로 설정하면 이름이 숨겨집니다.이 속성은 기본적으로 100 스터드로 설정됩니다.
플레이어가 게임에 참여하면 표시 거리를 변경하려면 Player.NameDisplayDistance 속성을 설정할 수 있습니다.
Humanoid 이름이 표시되는 경우 Humanoid.DisplayDistanceType를 사용하여 표시 유형을 설정할 수 있습니다.
코드 샘플
This example demonstrates how to hide other Humanoid's (Player and NPC) health bars and names.
This is done by setting the player's Player.HealthDisplayDistance and Player.NameDisplayDistance properties to 0.
If you would like to display health bars and names, you set the properties to a value greater than 0. For instance, setting the properties to 100 means that the player will see other player's health and names up to 100 studs away.
To modify the default values for players, you can change the values of the StarterClass.Player.HealthDisplayDistance and StarterClass.Player.NameDisplayDistance properties.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.HealthDisplayDistance = 0
player.NameDisplayDistance = 0