種類
種類 | 詳細 |
---|---|
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