Light

Light : Instance

Overview

The Light class provides the core properties and behaviors needed for creating and managing light sources. These lights are attached to parts in the game world and emit light to enhance realism or create specific visual effects.

Description

The Light class is an abstract base class used to define light sources that illuminate the 3D environment. It serves as the foundation for specific light types, such as PointLight, SpotLight, and SurfaceLight, which are used to create realistic lighting effects in a game. Since it is abstract, instances of the Light class cannot be created directly; instead, its derived classes are used.

Properties

Brightness

number

Brightness is a numerical property that controls the intensity of light emitted.

Code Samples

PointLight.Brightness = 5000

Color

Color3

Determines the color of the light, allowing for creative effects and mood setting.

Code Samples

PointLight.Color = Color3.new(255, 0, 0)

Enabled

bool

A boolean property that toggles the light on or off.

Code Samples

PointLight.Enabled = false

Shadows

bool

Determines whether objects block the light and cast shadows, adding realism to the scene.

Code Samples

print(PointLight.Shadows)

Methods

Events