PointLight
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
จุดไฟเป็นแหล่งแสงที่ปล่อยแสงออกจากจุดเดียว แสงจะปล่อยเป็นวงกลมตาม PointLight.Range ของจุดไฟ
เพื่อให้ PointLight จัดหาการสว่าง มันต้องเป็นลูกหลานของโดยตรงของ BasePart หรือ Attachment (ส่วนหรืออุปกรณ์เอทัดของมันต้องเป็นลูกหลานของ Workspace เท่านั้น)
หากมี PointLight อยู่ในรากของชิ้นส่วน แสงจะเรืองจากที่ BasePart.Position ของชิ้นส่วน หากมี PointLight อยู่ในรากของการแนบมัน แสงจะเรืองจากที่ Attachment.WorldPosition ของการแนบมัน
สำหรับประเภทไฟที่มากขึ้นดูที่ส่วน ดูเพิ่มเติม ด้วย
ดูเพิ่มเติม
ตัวอย่างโค้ด
This example creates a new anchored BasePart named Part at the position {0, 0, 0}.
It then creates a new point light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The point 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 point light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing point light, you can also create a similar script that modifies that 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("PointLight")
light.Color = Color3.new(1, 1, 1)
light.Brightness = 1
light.Range = 16
light.Parent = part
สรุป
คุณสมบัติ
ขนาดของพื้นที่ที่จุดไฟฉายจะสว่าง
ตั้งค่าความสว่างของแสงที่ปล่อย ปกติคือ 1
สีของแสงที่ปล่อย
ถ้าตั้งเป็นจริง แสงจะถูกปล่อยออกจากวัตถุที่เป็นแหล่ง
ถ้าตั้งค่าเป็น true จะโปรเจคเงาถ้าแสงถูกบล็อกโดยอุปสรรค