SurfaceLight
*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.
Uma Fonte de Luz é uma fonte de luz que emite iluminação de uma especificada Light.Color e Light.Brightness de um SurfaceLight.Face para uma especificada SurfaceLight.Range .
Para que uma Luz de Superfície forneça iluminação, deve ser o filho direto de um BasePart ou Attachment (a parte ou o anexo em si deve ser um descendente do Workspacede Trabalho).Se uma Luz de Superfície for associada a uma peça, então a luz emanará das faces selecionadas da peça.Se for parente de um anexo, a SurfaceLight é equivalente a um SpotLight .
Para mais tipos de luz, consulte a seção ver também .
Veja também
Amostras de código
This example creates a new anchored BasePart named Part at the position {0, 0, 0}.
It then creates a new surface light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The surface light's parent is set to the BasePart we created. To view the light, navigate to the part at {0, 0, 0} or move the Part created to a location visible to the player.
Please note that the properties of the created surface light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing surface light, you can also create a similar script that modifies that surface light instead of creating a new BasePart and light.
local part = Instance.new("Part")
part.Anchored = true
part.Position = Vector3.new(0, 0, 0)
part.Parent = workspace
local light = Instance.new("SurfaceLight")
light.Color = Color3.fromRGB(255, 255, 255)
light.Brightness = 1
light.Range = 16
light.Parent = part
Resumo
Propriedades
O ângulo de que a luz é irradiada a partir da SurfaceLight.
Define o lado do pai de onde a Luz de Superfície vem.
A distância do rosto da Luz de Superfície que vai iluminar.
Define quão brilhante é a luz emitida, padrão para 1.
A cor da luz emitida.
Se definido como verdadeiro, a luz será emitida do Objetode origem.
Se definido como verdadeiro, projetará sombras se a luz for bloqueada por um obstáculo.