SurfaceLight

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

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

A SurfaceLight เป็นแหล่งไฟที่ปล่อยการส่องสว่างของ Light.Color และ Light.Brightness จาก Class.SurfaceLight.Face สำหรับ SurfaceLight.Face ที่กำหนด

เพื่อให้ SurfaceLight ให้การสว่าง มันต้องเป็นลูกหลานของ BasePart หรือ Attachment (ส่วนหรืออุปกรณ์เสริมจะต้องเป็นลูกหล

สำหรับประเภทไฟที่มากขึ้นโปรดดูส่วน ดูเพิ่มเติม ของหน้า

ดูเพิ่มเติม

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

This example creates a new anchored BasePart named Part at the position {0, 0, 0}.

It then creates a new surface light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The surface light's parent is set to the BasePart we created. To view the light, navigate to the part at {0, 0, 0} or move the Part created to a location visible to the player.

Please note that the properties of the created surface light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing surface light, you can also create a similar script that modifies that surface light instead of creating a new BasePart and light.

Creating a New Surface Light

local part = Instance.new("Part")
part.Anchored = true
part.Position = Vector3.new(0, 0, 0)
part.Parent = workspace
local light = Instance.new("SurfaceLight")
light.Color = Color3.fromRGB(255, 255, 255)
light.Brightness = 1
light.Range = 16
light.Parent = part

สรุป

คุณสมบัติ

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

    มุมที่แสงสว่างส่องออกจากพื้นผิวแสง

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

    ตั้งค่าด้านข้างของพ่อที่ SurfaceLight มาจาก

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

    ระยะทางจาก SurfaceLight ที่จะส่องแสง

คุณสมบัติรับทอดมาจากLight
  • อ่านพร้อมๆ กัน

    ตั้งค่าความสว่างของแสงที่ปล่อย ปกติคือ 1

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

    สีของแสงที่ปล่อย

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

    ถ้าตั้งเป็นจริง แสงจะถูกปล่อยออกจากวัตถุที่เป็นแหล่ง

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

    ถ้าตั้งค่าเป็น true จะโปรเจคเงาถ้าแสงถูกบล็อกโดยอุปสรรค

คุณสมบัติ

Angle

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

มุมที่แสงสว่างส่องออกจากพื้นผิวแสง

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

ตั้งค่าด้านข้างของพ่อที่ SurfaceLight มาจาก

Range

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

ระยะทางจาก SurfaceLight ที่จะส่องแสง

วิธีการ

อีเวนต์