PointLight

Mostrar obsoleto

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.

Um PointLight é uma fonte de luz que emite iluminação de um único ponto. A luz é emitida esfericamente com base no PointLight.Range do PointLight.

Para que um PointLight 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 Workspace ).

Se um PointLight for associado a uma peça, então a luz emanará do BasePart.Position da peça.Se um PointLight for associado a um anexo, então a luz emanará do anexo de Attachment.WorldPosition.

Para mais tipos de luz, veja 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 point light with brightness of 1, Color3 color of {255/255, 255/255, 255/255} (white) and range of 16 studs. The point 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 point light can easily be changed by modifying the property values in the code sample below. Additionally, if you have an existing point light, you can also create a similar script that modifies that light instead of creating a new BasePart and light.

Creating a New Point Light

local part = Instance.new("Part")
part.Anchored = true
part.Position = Vector3.new(0, 0, 0)
part.Parent = workspace
local light = Instance.new("PointLight")
light.Color = Color3.new(1, 1, 1)
light.Brightness = 1
light.Range = 16
light.Parent = part

Resumo

Propriedades

  • Ler Parallel

    O tamanho da área que o PointLight irá 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

Range

Ler Parallel

O tamanho da área que o PointLight irá iluminar.

Métodos

Eventos