PointLight

Mostrar obsoleto

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

Un PointLight es una fuente de luz que emite iluminación desde un solo punto. La luz se emite en forma de esfera según el PointLight.Range de la PointLight.

Para que un PointLight proporcione iluminación, debe ser el hijo directo de un BasePart o Attachment (la parte o el accesorio en sí mismo debe ser un descendiente del Workspace).

Si un PointLight está asociado a una parte, entonces la luz emanará de la parte. BasePart.Position . Si un PointLight está asociado a un conexión, entonces la luz emanará del conexión. Attachment.WorldPosition .

Para más tipos de luz, see la sección ver también .

Ver también

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

    El tamaño de la área que iluminará el PointLight.

Propriedades herdados de Light
  • Ler Parallel

    Define a quantidade de luz emitida, padrão para 1.

  • Ler Parallel

    A cor da luz emitida.

  • Ler Parallel

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

  • Ler Parallel

    Se definido como verdadeiro, projetar sombras se as luzes forem bloqueadas por um obstáculo.

Propriedades

Range

Ler Parallel

El tamaño de la área que iluminará el PointLight.

Métodos

Eventos