Tipi
Tipi | Dettagli |
---|---|
PointLight | Emette luce in tutte le direzioni da un unico punto. |
SpotLight | Emette luce a forma di cono, utile per creare fasci focalizzati. |
SurfaceLight | Emette luce da una superficie in una direzione, utile per l'illuminazione di aree. |
Proprietà
Proprietà | Dettagli |
---|---|
Brightness | Controlla l'intensità della luce. |
Color | Imposta il colore della luce. |
Range | Determina quanto lontano arriva la luce. |
Shadows | Abilita o disabilita le ombre proiettate dalla luce. |
Angle | Definisce la diffusione del fascio di luce. (SpotLight e SurfaceLight) |
Face | Specifica la direzione da cui viene emessa la luce. (SpotLight e SurfaceLight) |
Enabled | Attiva o disattiva la luce. |
Esempi di Illuminazione
Utilizzo di 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
Utilizzo di 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
Utilizzo di 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
Se hai trovato utile questo tutorial e desideri supportare il mio lavoro, considera di offrirmi un caffè.
Grazie mille per il tuo supporto!
Offrimi un caffè