Typen
Typen | Details |
---|---|
PointLight | Zendt licht uit in alle richtingen vanaf een enkel punt. |
SpotLight | Zendt licht uit in een kegelvorm, handig voor het creëren van gerichte bundels. |
SurfaceLight | Zendt licht uit vanaf een oppervlak in één richting, handig voor gebiedsverlichting. |
Eigenschappen
Eigenschappen | Details |
---|---|
Brightness | Regelt de intensiteit van het licht. |
Color | Stelt de kleur van het licht in. |
Range | Bepaalt hoe ver het licht reikt. |
Shadows | Schakelt schaduwen in of uit die door het licht worden geworpen. |
Angle | Bepaalt de spreiding van de lichtbundel. (SpotLight en SurfaceLight) |
Face | Specificeert de richting waaruit het licht wordt uitgestraald. (SpotLight en SurfaceLight) |
Enabled | Schakelt het licht aan of uit. |
Licht Voorbeelden
Gebruik van een 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
Gebruik van een 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
Gebruik van een 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
Als u deze tutorial nuttig vond en mijn werk wilt ondersteunen, overweeg dan om mij een kop koffie te kopen.
Hartelijk dank voor uw steun!
Koop een kop koffie voor mij