SurfaceLight

Mostrar obsoleto

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.

Una fuente de luz de superficie es una fuente de luz que emite la iluminación de una especificada Light.Color y Light.Brightness de una fuente de luz de SurfaceLight.Face para una especificada SurfaceLight.Range .

Para que un SurfaceLight proporcione iluminación, debe ser el hijo directo de un BasePart o Attachment (la parte o el accesorio en sí debe ser un descendiente del espacio de trabajo).Si una luz de superficie está asociada a una parte, entonces la luz emanará de la cara seleccionada de la parte.Si se asigna a una superficie de adjunto, SurfaceLight es equivalente a un SpotLight .

Para más tipos de luz, consulte la sección también vea .

Ver también

Muestras 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

Resumen

Propiedades

  • Leer paralelo

    El ángulo desde el cual se ilumina la luz desde la SurfaceLight.

  • Leer paralelo

    Establece el lado del padre del que proviene la SurfaceLight.

  • Leer paralelo

    La distancia desde el rostro de la SurfaceLight que iluminará.

Propiedades heredados de Light
  • Leer paralelo

    Establece cuán brillante es la luz emitida, por defecto a 1.

  • Leer paralelo

    El color de la luz emitida.

  • Leer paralelo

    Si se establece en verdadero, se emitirá luz desde el objeto de origen.

  • Leer paralelo

    Si se establece en verdadero, proyectará sombras si la luz es bloqueada por un obstáculo.

Propiedades

Angle

Leer paralelo

El ángulo desde el cual se ilumina la luz desde la SurfaceLight.

Leer paralelo

Establece el lado del padre del que proviene la SurfaceLight.

Range

Leer paralelo

La distancia desde el rostro de la SurfaceLight que iluminará.

Métodos

Eventos