PointLight

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

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

จุดแสงเป็นแหล่งกำเนิดแสงที่ปล่อยแสงจากจุดเดียว แสงจะถูกส่งออกเป็นวงกลมตาม PointLight.Range ของจุดแสง

เพื่อให้จุดแสงให้ความสว่าง ต้องเป็นบุตรโดยตรงของ BasePart หรือ Attachment (ส่วนหรือส่วนประกอบด้วยตัวเองต้องเป็นลูกหลานของ Workspace )

หากจุดแสงได้รับการผูกกับส่วน แสงจะปล่อยออกจากส่วน BasePart.Positionหากจุดแสงได้รับการผูกกับสิ่งแนบเนียน แสงจะปล่อยออกจากสิ่งแนบเนียน 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.

Creating a New Point 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

สรุป

คุณสมบัติ

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

    ขนาดของพื้นที่ที่จุดแสงจะส่องแสง

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

    ตั้งค่าความสว่างของแสงที่ปล่อยออกเป็น 1 โดยค่าเริ่มต้น

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

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

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

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

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

    หากตั้งค่าเป็นจริงจะโครงสร้างเงาหากแสงถูกบล็อกโดยสิ่งกีดขวาง

คุณสมบัติ

Range

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

ขนาดของพื้นที่ที่จุดแสงจะส่องแสง

วิธีการ

อีเวนต์