SurfaceLight
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
แสงพื้นผิวเป็นแหล่งกำเนิดแสงที่ปล่อยแสงสว่างของสิ่งที่กำหนด Light.Color และ Light.Brightness จาก SurfaceLight.Face สำหรับสิ่งที่กำหนด SurfaceLight.Range
เพื่อให้แสงพื้นผิวให้ความสว่าง ต้องเป็นบุตรโดยตรงของ BasePart หรือ Attachment (ส่วนหรือส่วนประกอบด้วยตัวเองต้องเป็นลูกหลานของพื้นที่ทำงาน)หากแสงพื้นผิวได้รับการผูกกับชิ้นส่วนแล้ว แสงจะปล่อยออกจากใบหน้าที่เลือกของชิ้นส่วนหากเป็นลูกของพื้นที่แนบเนียน SurfaceLight จะเท่ากับ SpotLight
สำหรับประเภทแสงเพิ่มเติมโปรดดูส่วน ดูเพิ่มเติม
ดูเพิ่มเติม
ตัวอย่างโค้ด
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.
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 ที่จะส่องแสง
ตั้งค่าความสว่างของแสงที่ปล่อยออกเป็น 1 โดยค่าเริ่มต้น
สีของแสงที่ปล่อยออก
หากตั้งค่าเป็นจริงแสงจะถูกปล่อยออกจากวัตถุที่เป็นที่มา
หากตั้งค่าเป็นจริงจะโครงสร้างเงาหากแสงถูกบล็อกโดยสิ่งกีดขวาง