Arten
Arten | Details |
---|---|
PointLight | Strahlt Licht in alle Richtungen von einem einzigen Punkt aus. |
SpotLight | Strahlt Licht in einer Kegelform aus, ideal für gerichtete Lichtstrahlen. |
SurfaceLight | Strahlt Licht von einer Oberfläche in eine Richtung aus, nützlich für Flächenbeleuchtung. |
Eigenschaften
Eigenschaften | Details |
---|---|
Brightness | Steuert die Intensität des Lichts. |
Color | Legt die Farbe des Lichts fest. |
Range | Bestimmt, wie weit das Licht reicht. |
Shadows | Aktiviert oder deaktiviert die Schatten, die das Licht wirft. |
Angle | Definiert die Ausbreitung des Lichtstrahls. (SpotLight und SurfaceLight) |
Face | Gibt die Richtung an, aus der das Licht ausgestrahlt wird. (SpotLight und SurfaceLight) |
Enabled | Schaltet das Licht ein oder aus. |
Lichtbeispiele
Verwendung eines 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
Verwendung eines 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
Verwendung eines 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
Wenn Sie dieses Tutorial hilfreich fanden und meine Arbeit unterstützen möchten, können Sie mir gerne einen Kaffee spendieren.
Vielen Dank für Ihre Unterstützung!
Kaufen Sie mir einen Kaffee