Luz

Tipos

TiposDetalhes
PointLightEmite luz em todas as direções a partir de um único ponto.
SpotLightEmite luz em formato de cone, útil para criar feixes focados.
SurfaceLightEmite luz de uma superfície em uma direção, útil para iluminação de áreas.

Propriedades

PropriedadesDetalhes
BrightnessControla a intensidade da luz.
ColorDefine a cor da luz.
RangeDetermina o alcance da luz.
ShadowsAtiva ou desativa as sombras projetadas pela luz.
AngleDefine a propagação do feixe de luz. (SpotLight e SurfaceLight)
FaceEspecifica a direção de onde a luz é emitida. (SpotLight e SurfaceLight)
EnabledAtiva ou desativa a luz.

Exemplos de Luz

Usando 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

Usando 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

Usando 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

Se você achou este tutorial útil e gostaria de apoiar meu trabalho, por favor, considere me comprar um café.

Muito obrigado pelo seu apoio!

Me compre um café