유형
유형 | 세부 사항 |
---|---|
PointLight | 단일 지점에서 모든 방향으로 빛을 발산합니다. |
SpotLight | 원뿔 형태로 빛을 발산하여 집중된 광선을 만듭니다. |
SurfaceLight | 표면에서 한 방향으로 빛을 발산하여 넓은 영역을 밝힙니다. |
속성
속성 | 세부 사항 |
---|---|
Brightness | 빛의 강도를 제어합니다. |
Color | 빛의 색상을 설정합니다. |
Range | 빛이 닿는 거리를 결정합니다. |
Shadows | 빛이 투사하는 그림자를 활성화하거나 비활성화합니다. |
Angle | 빛의 광선 확산을 정의합니다. (SpotLight 및 SurfaceLight) |
Face | 빛이 발사되는 방향을 지정합니다. (SpotLight 및 SurfaceLight) |
Enabled | 조명을 켜거나 끕니다. |
조명 예시
PointLight 사용하기
local part = script.Parent
local pointLight = Instance.new("PointLight")
pointLight.Parent = part
pointLight.Brightness = 2 -- Controls the intensity of the light
pointLight.Color = Color3.fromRGB(255, 255, 255) -- White light
pointLight.Range = 16 -- How far the light reaches
pointLight.Shadows = true -- Enable shadows
pointLight.Enabled = true -- Ensure the light is turned on
-- Function to toggle the light on and off every 1 second
while true do
pointLight.Enabled = not pointLight.Enabled -- Toggle the light's enabled state
wait(1) -- Wait for 1 second before toggling again
end
Roblox Studio
SpotLight 사용하기
local part = script.Parent
local spotLight = Instance.new("SpotLight")
spotLight.Parent = part
spotLight.Brightness = 8 -- Controls the intensity of the light
spotLight.Color = Color3.fromRGB(255, 255, 255) -- White light
spotLight.Range = 16 -- How far the light reaches
spotLight.Shadows = true -- Enable shadows
spotLight.Angle = 90 -- Width of the cone (in degrees)
spotLight.Face = Enum.NormalId.Front -- Direction the light is facing
spotLight.Enabled = true -- Ensure the light is turned on
-- Function to toggle the light on and off every 1 second
while true do
spotLight.Enabled = not spotLight.Enabled -- Toggle the light's enabled state
wait(1) -- Wait for 1 second before toggling again
end
Roblox Studio
SurfaceLight 사용하기
local part = script.Parent
local pointLight = Instance.new("PointLight")
pointLight.Parent = part
pointLight.Brightness = 2 -- Controls the intensity of the light
pointLight.Color = Color3.fromRGB(255, 255, 255) -- White light
pointLight.Range = 16 -- How far the light reaches
pointLight.Shadows = true -- Enable shadows
pointLight.Enabled = true -- Ensure the light is turned on
-- Function to toggle the light on and off every 1 second
while true do
pointLight.Enabled = not pointLight.Enabled -- Toggle the light's enabled state
wait(1) -- Wait for 1 second before toggling again
end
Roblox Studio