表面灯是一个发出照明特定 Light.Color 和 Light.Brightness 的灯源,从 SurfaceLight.Face 为指定的 1> Class.SurfaceLight.Range1> 发出照明。
要使用SurfaceLight提供照明,它必须是BasePart或Attachment的直接子女(零件或附件本身必须是工作区的后代)。 如果SurfaceLight与父亲有关,那么灯光就会从父亲选定的面(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
概要
属性
从表面灯照射角度的角度。
设置 SurfaceLight 的父亲的侧面。
从 SurfaceLight 的面那里的距离,会照亮。
设置发射的灯光的亮度,默认为 1。
发射的灯的颜色。
设置为“真”,光将从源对象发出。
设置为“真”,如果光被遮蔽,将投射阴影。