SurfaceLight

Mostrar obsoleto

*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.

Creating a New Surface 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

  • Ler Parallel

    O ângulo de que a luz é irradiada a partir da SurfaceLight.

  • Ler Parallel

    Define o lado do pai de onde a Luz de Superfície vem.

  • Ler Parallel

    A distância do rosto da Luz de Superfície que vai iluminar.

Propriedades herdados de Light
  • Ler Parallel

    Define quão brilhante é a luz emitida, padrão para 1.

  • Ler Parallel

    A cor da luz emitida.

  • Ler Parallel

    Se definido como verdadeiro, a luz será emitida do Objetode origem.

  • Ler Parallel

    Se definido como verdadeiro, projetará sombras se a luz for bloqueada por um obstáculo.

Propriedades

Angle

Ler Parallel

O ângulo de que a luz é irradiada a partir da SurfaceLight.

Ler Parallel

Define o lado do pai de onde a Luz de Superfície vem.

Range

Ler Parallel

A distância do rosto da Luz de Superfície que vai iluminar.

Métodos

Eventos