Licht

Typen

TypenDetails
PointLightZendt licht uit in alle richtingen vanaf een enkel punt.
SpotLightZendt licht uit in een kegelvorm, handig voor het creëren van gerichte bundels.
SurfaceLightZendt licht uit vanaf een oppervlak in één richting, handig voor gebiedsverlichting.

Eigenschappen

EigenschappenDetails
BrightnessRegelt de intensiteit van het licht.
ColorStelt de kleur van het licht in.
RangeBepaalt hoe ver het licht reikt.
ShadowsSchakelt schaduwen in of uit die door het licht worden geworpen.
AngleBepaalt de spreiding van de lichtbundel. (SpotLight en SurfaceLight)
FaceSpecificeert de richting waaruit het licht wordt uitgestraald. (SpotLight en SurfaceLight)
EnabledSchakelt 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
Image 1
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
Image 1
Image 2
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
Image 1
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