地面燈是一種發出特定Light.Color和Light.Brightness的燈,從SurfaceLight.Face發出具有特定1>Class.SurfaceLight.Range1>的燈。
要使用SurfaceLight提供照明,它必須是 Class.BasePart 或 Class.附件 的直接子孫 (零件或附件自身必須是 Workspace 的後代)。如果SurfaceLight與附件相關,則會從 Class.SpotLight 的子面(s)發射光。如果與附件相關,則
有關更多的光類型,請參閱 也見 區。
也看看
範例程式碼
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
概要
屬性
從表面燈光下射出的角度。
設定表面燈從哪一側來自。
從表面燈光面那裡距離。
設定發射的光是否有足夠的亮度,預設為 1。
發射的光的顏色。
設定為 "真" 時,光線將從來源對物件發射。
設定為 "真" 時,若光被障礙物阻擋,就會投影影子。