StarterPlayer

แสดงที่เลิกใช้งานแล้ว

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่

ไม่สามารถสร้าง
บริการ

บริการที่ช่วยให้ค่าเริ่มต้นของคุณสมบัติในวัตถุ Player สามารถตั้งค่าได้เมื่อผู้เล่นเข้าสู่เซิร์ฟเวอร์แต่ละคุณสมบัติของวัตถุผู้เล่นจะถูกตั้งค่าเป็นค่าปัจจุบันของคุณสมบัติที่ตรงกันใน StarterPlayer

นอกจากนี้คุณยังสามารถเพิ่มสี่วัตถุให้บริการนี้:

  • ตัวอย่าง StarterPlayerScripts ที่มีสคริปต์ที่เรียกเพียงครั้งเดียวสำหรับผู้เล่นแต่ละคน
  • ตัวอย่าง StarterCharacterScripts ที่มีสคริปต์เพื่อเพิ่มตัวละครของผู้เล่นแต่ละครั้งที่พวกเขาจะเกิด
  • ตัวอย่าง Humanoid ที่มีชื่อ StarterHumanoid ซึ่งจะถูกใช้เป็นหุ่นยนต์เริ่มต้นสำหรับตัวละครของผู้เล่นแต่ละคน
  • ตัวอย่าง Model ที่ชื่อว่า StarterCharacter ซึ่งจะถูกใช้เป็นโมเดลตัวละครสำหรับผู้เล่นทั้งหมด

สรุป

คุณสมบัติ

  • ซ่อนอยู่
    การรักษาความปลอดภัยของสคริปต์ Roblox
    อ่านพร้อมๆ กัน

    อธิบายระดับสิทธิ์ปัจจุบันของเกมเกี่ยวกับแอนิเมชั่นอวาตาร์ที่กำหนดเองจากเว็บไซต์

  • อ่านพร้อมๆ กัน

    ตั้งค่าว่าตัวละครจะกระโดดโดยอัตโนมัติเมื่อชนกับอุปสรรคบนอุปกรณ์เคลื่อนที่หรือไม่

  • ไม่ซ้ำ
    ไม่สามารถเขียนสคริปต์
    ไม่สามารถเรียกดู
    อ่านพร้อมๆ กัน
  • อ่านพร้อมๆ กัน

    ระยะสูงสุดที่กล้องเริ่มต้นของผู้เล่นสามารถซูมออกได้ในสตัด

  • อ่านพร้อมๆ กัน

    ระยะขั้นต่ำในสตัดที่กล้องเริ่มต้นของผู้เล่นสามารถซูมได้

  • อ่านพร้อมๆ กัน

    เปลี่ยนโหมดกล้องเริ่มต้นเป็นคนแรกหรือคนที่สาม

  • อ่านพร้อมๆ กัน

    กำหนดมูลค่าเริ่มต้นของ Humanoid.JumpHeight สำหรับ Player.Character

  • อ่านพร้อมๆ กัน

    กำหนดมูลค่าเริ่มต้นของ Humanoid.JumpPower สำหรับ Player.Character

  • อ่านพร้อมๆ กัน

    กำหนดมูลค่าเริ่มต้นของ Humanoid.MaxSlopeAngle สำหรับ Player.Character

  • อ่านพร้อมๆ กัน

    กำหนดสถานะเริ่มต้นของ Humanoid.UseJumpPower สำหรับ Player.Character

  • อ่านพร้อมๆ กัน

    กำหนดมูลค่าเริ่มต้นของ Humanoid.WalkSpeed สำหรับ Player.Character

  • ไม่สามารถเรียกดู
    อ่านพร้อมๆ กัน
  • อ่านพร้อมๆ กัน

    กำหนดวิธีที่กล้องเริ่มต้นจัดการวัตถุระหว่างกล้องและผู้เล่น

  • ให้นักพัฒนาเขียนทับโหมดกล้องเริ่มต้นสำหรับผู้เล่นแต่ละคนหากผู้เล่นอยู่บนคอมพิวเตอร์

  • อ่านพร้อมๆ กัน

    ให้นักพัฒนาเขียนทับโหมดการเคลื่อนไหวของผู้เล่นหากผู้เล่นอยู่บนคอมพิวเตอร์

  • อ่านพร้อมๆ กัน

    ให้นักพัฒนาเขียนทับโหมดการเคลื่อนไหวกล้องเริ่มต้นสำหรับแต่ละผู้เล่นหากผู้เล่นอยู่บนอุปกรณ์เคลื่อนที่

  • อ่านพร้อมๆ กัน

    ให้นักพัฒนาเขียนทับโหมดการเคลื่อนไหวของผู้เล่นหากผู้เล่นอยู่บนอุปกรณ์สัมผัส

  • ไม่สามารถเขียนสคริปต์
    อ่านพร้อมๆ กัน
  • อ่านพร้อมๆ กัน

    กำหนดว่าผู้เล่นสามารถเปิดใช้งานการล็อคเมาส์โดยปกติได้หรือไม่

  • อ่านพร้อมๆ กัน

    ตั้งระยะที่ผู้เล่นรายนี้จะเห็นแถบสุขภาพอื่น ๆ Humanoid หากตั้งค่าเป็น 0 แถบสุขภาพจะไม่แสดง

  • อ่านพร้อมๆ กัน

    ว่าจะโหลดรูปลักษณ์ของตัวละครของผู้เล่นหรือไม่

  • ไม่ซ้ำ
    ไม่สามารถเขียนสคริปต์
    อ่านพร้อมๆ กัน

    บ่งบอกว่าตัวละครที่เกิดในประสบการณ์จะมีอุปกรณ์เสริมเสื้อผ้าชั้นในติดตั้งอยู่บนพวกเขาหรือไม่

  • ไม่สามารถเรียกดู
    อ่านพร้อมๆ กัน
  • อ่านพร้อมๆ กัน

    ตั้งระยะที่ผู้เล่นรายนี้จะเห็นชื่ออื่น ๆ Humanoid ได้

  • ไม่สามารถเรียกดู
    อ่านพร้อมๆ กัน
  • อ่านพร้อมๆ กัน

    ตัดสินว่าอีโมทที่เป็นเจ้าของของผู้ใช้จะถูกโหลดเมื่อโหลดตัวละครหรือไม่

คุณสมบัติ

AllowCustomAnimations

ซ่อนอยู่
การรักษาความปลอดภัยของสคริปต์ Roblox
อ่านพร้อมๆ กัน

คุณสมบัตินี้อธิบายระดับสิทธิ์ปัจจุบันของเกมเกี่ยวกับอวตารที่กําหนดเอง Animations จากเว็บไซต์

ดังนั้นค่านี้จึงไม่สามารถเปลี่ยนได้จากภายในเกมสามารถเปลี่ยนได้โดยการเปลี่ยนระดับการอนุญาตของเกมภายในหน้าการตั้งค่าเกมบนเว็บไซต์

คุณสมบัตินี้ไม่ได้มีไว้สำหรับใช้ในเกม

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 ค่าจะถูกเพิ่มเป็นระยะการซูมกล้อง

ตัวอย่างโค้ด

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.

Setting Camera Zoom Distance

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.

Setting Camera Zoom Distance

local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CameraMaxZoomDistance = 50
player.CameraMinZoomDistance = 75

CameraMode

อ่านพร้อมๆ กัน

ตั้งค่าค่าเริ่มต้นสำหรับ Player.CameraMode สำหรับผู้เล่นแต่ละคนในเกม กล้องมีสองโหมด:

บุคคลแรก

ในโหมดคนแรก กล้องของผู้เล่นจะซูมตลอดทางยกเว้นมี GUI ที่มองเห็นได้พร้อมกับคุณสมบัติ GuiButton.Modal ที่ตั้งค่าเป็น true เมาส์จะถูกล็อคและกล้องของผู้ใช้จะหมุนตามที่เมาส์เคลื่อนที่

คนที่สาม

ในโหมดบุคคลที่สาม (เริ่มต้น) ตัวละครสามารถมองเห็นได้ในกล้อง ในโหมดบุคคลที่สามบน Roblox:

  • คุณสามารถคลิกขวาและลากเพื่อหมุนกล้องหรือใช้ปุ่มลูกศรที่ด้านล่างขวามือของหน้าจอ
  • เมื่อคุณย้ายเมาส์ของคุณ กล้องของคุณจะไม่เปลี่ยน (เว้นแต่คุณจะย้ายเมาส์ไปที่ด้านท้ายของหน้าจอ)
  • เมื่อคุณกดปุ่มลูกศรใดก็ตาม คีย์
  • คุณสามารถซูมเข้าและออกได้อย่างอิสระ

ตัวอย่างโค้ด

This example demonstrates how to change the character's CameraMode to first person using the LockFirstPerson value of the Enum.CameraMode enum.

Playing in First Person

local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson

CharacterJumpHeight

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดค่าเริ่มต้นของ Humanoid.JumpHeight สำหรับผู้เล่น Player.Character ค่าของคุณสมบัตินี้จะเป็น 7.2 สตัด โดยค่าเริ่มต้น

คุณสมบัตินี้จะปรากฏเฉพาะในหน้าต่างคุณสมบัติ หาก StarterPlayer.CharacterUseJumpPower ถูกตั้งค่าเป็น false เนื่องจากจะไม่เกี่ยวข้องอย่างอื่น

เนื่องจากคุณสมบัตินี้เกี่ยวข้องเฉพาะกับตัวละครที่จะถูกสร้างขึ้นในอนาคตเท่านั้น การเปลี่ยนแปลงจะไม่เปลี่ยนตัวละครผู้เล่นที่มีอยู่แล้วการเปลี่ยนแปลงของคุณสมบัตินี้จะมีผลเฉพาะเมื่อผู้เล่นเกิดใหม่

CharacterJumpPower

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดค่าเริ่มต้นของ Humanoid.JumpPower สำหรับ Player.Character ของผู้เล่นค่าของคุณสมบัตินี้จะเป็น 0 เมื่อใช้กับผู้เล่น Humanoid จะถูกจำกัดระหว่าง 0 และ 1000

คุณสมบัตินี้จะปรากฏเฉพาะในหน้าต่างคุณสมบัติ หาก StarterPlayer.CharacterUseJumpPower ถูกตั้งค่าเป็น true เนื่องจากจะไม่เกี่ยวข้องอย่างอื่น

เนื่องจากคุณสมบัตินี้เกี่ยวข้องเฉพาะกับตัวละครที่จะถูกสร้างขึ้นในอนาคตเท่านั้น การเปลี่ยนแปลงจะไม่เปลี่ยนตัวละครผู้เล่นที่มีอยู่แล้วการเปลี่ยนแปลงของคุณสมบัตินี้จะมีผลเฉพาะเมื่อผู้เล่นเกิดใหม่

CharacterMaxSlopeAngle

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดค่าเริ่มต้นของ Humanoid.MaxSlopeAngle สำหรับ Player.Character ของผู้เล่นมันเริ่มต้นที่ 89° ดังนั้นมนุษย์สามารถปีนเขาได้เกือบทุกระดับที่พวกเขาต้องการโดยปกติเมื่อใช้กับ Humanoid จะถูกจำกัดระหว่าง 0 และ 89

เนื่องจากคุณสมบัตินี้เกี่ยวข้องเฉพาะกับตัวละครที่จะถูกสร้างขึ้นในอนาคตเท่านั้น การเปลี่ยนแปลงจะไม่เปลี่ยนตัวละครผู้เล่นที่มีอยู่แล้วการเปลี่ยนแปลงของคุณสมบัตินี้จะมีผลเฉพาะเมื่อผู้เล่นเกิดใหม่

CharacterUseJumpPower

อ่านพร้อมๆ กัน

CharacterUseJumpPower กำหนดค่าเริ่มต้นของ Humanoid.UseJumpPower สำหรับผู้เล่น Player.Characterการสลับจะเปลี่ยนคุณสมบัติที่ปรากฏในหน้าต่างคุณสมบัติ: CharacterJumpHeight (ปิด) หรือ StarterPlayer.CharacterJumpPower (เปิด)ค่าเริ่มต้นเป็นจริง

เนื่องจากคุณสมบัตินี้เกี่ยวข้องเฉพาะกับตัวละครที่จะถูกสร้างขึ้นในอนาคตเท่านั้น การเปลี่ยนแปลงจะไม่เปลี่ยนตัวละครผู้เล่นที่มีอยู่แล้วการเปลี่ยนแปลงของคุณสมบัตินี้จะมีผลเฉพาะเมื่อผู้เล่นเกิดใหม่

CharacterWalkSpeed

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดค่าเริ่มต้นของ Humanoid.WalkSpeed สำหรับ Player.Character ของผู้เล่น คุณสมบัตินี้จะเริ่มต้นที่ 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.

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

อ่านพร้อมๆ กัน

คุณสมบัตินี้ช่วยให้นักพัฒนาเขียนทับโหมดการเคลื่อนไหวของผู้เล่นหากผู้เล่นอยู่บนคอมพิวเตอร์

นี่คือคุณสมบัติเริ่มต้นสำหรับผู้เล่นที่เข้าร่วมเกม สามารถเปลี่ยนแปลงสำหรับผู้เล่นแต่ละคนโดยการตั้งค่า Player.DevComputerMovementMode

หากตั้งค่าเป็น UserChoice โหมดการเคลื่อนที่ของผู้เล่นจะถูกกำหนดโดยสิ่งที่ผู้เล่นตั้งค่าไว้ในการตั้งค่าเกมมิฉะนั้นโหมดจะถูกตั้งค่าตามคุณสมบัตินี้

ดู Enum.DevComputerMovementMode สำหรับโหมดการเคลื่อนที่ที่แตกต่างกันที่มีอยู่ ให้นักพัฒนาเขียนทับโหมดการเคลื่อนที่ของผู้เล่นหากผู้เล่นอยู่บนคอมพิวเตอร์

คุณสมบัตินี้ไม่มีผลต่อผู้เล่นที่ไม่ได้อยู่บนคอมพิวเตอร์

ตัวอย่างโค้ด

Demonstrates how to set the movement mode for players on computers using the Player.DevComputerMovementMode property.

Setting a Player's Movement Mode (Desktop)

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.

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

อ่านพร้อมๆ กัน

คุณสมบัตินี้ช่วยให้นักพัฒนาสามารถเขียนทับโหมดการเคลื่อนไหวของผู้เล่นหากผู้เล่นอยู่บนอุปกรณ์สัมผัส

นี่คือคุณสมบัติเริ่มต้นสำหรับผู้เล่นที่เข้าร่วมเกม สามารถเปลี่ยนแปลงสำหรับผู้เล่นแต่ละคนโดยการตั้งค่า 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.

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

ไม่สามารถเขียนสคริปต์
อ่านพร้อมๆ กัน

EnableMouseLockOption

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดว่าผู้เล่นสามารถเปิดใช้งานการล็อคเมาส์โดยปกติได้หรือไม่

Mouse Lock จะล็อคเคอร์เซอร์ของผู้เล่นไปที่ศูนย์กลางของหน้าจอการเคลื่อนเมาส์จะหมุน 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.

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

อ่านพร้อมๆ กัน

คุณสมบัตินี้ตั้งระยะในสตัดที่ผู้เล่นรายนี้จะเห็นแถบสุขภาพอื่น ๆ 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.

Hiding Player Health and Names

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.

Disabling a Player's Appearance

local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.CanLoadCharacterAppearance = false

LoadCharacterLayeredClothing

ไม่ซ้ำ
ไม่สามารถเขียนสคริปต์
อ่านพร้อมๆ กัน

บ่งบอกว่าตัวละครที่เกิดในประสบการณ์จะมีอุปกรณ์เสริมเสื้อผ้าชั้นในติดตั้งอยู่บนพวกเขาหรือไม่ (แม้ว่า Workspace.MeshPartHeadsAndAccessories จะต้องเปิดใช้งานใน Workspace ก็ตาม)

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.

Hiding Player Health and Names

local Players = game:GetService("Players")
local player = Players.LocalPlayer
player.HealthDisplayDistance = 0
player.NameDisplayDistance = 0

RagdollDeath

ไม่สามารถเรียกดู
อ่านพร้อมๆ กัน

UserEmotesEnabled

อ่านพร้อมๆ กัน

คุณสมบัตินี้กำหนดว่าจะโหลดอีโมทที่เป็นเจ้าของของผู้ใช้เมื่อโหลดตัวละครหรือไม่การตั้งค่าคุณสมบัตินี้เป็น false จะปิดการโหลดนักพัฒนาสามารถตั้งค่าคุณสมบัติใน Studio โดยตรงหรือผ่านเมนู การตั้งค่าเกม

เมื่อการโหลดอีโมทถูกปิดใช้งาน อินเทอร์เฟซผู้ใช้อีโมทจะยังคงทำงานต่อไปตราบเท่าที่ผู้พัฒนาเลือกที่จะใช้คุณลักษณะอีโมทโดยการเพิ่มอีโมทภายในเกม

ดูเพิ่มเติม อีโมทอวาตาร์ บทความที่อธิบายวิธีการควบคุม ปรับแต่ง และเล่นอีโมทอวาตาร์

วิธีการ

อีเวนต์