PointLight
A light that shines in every direction from the part it’s in.
- Inherits: Instance
- Creatable: Yes:
new PointLight(), orInstance.new('PointLight', parent). - Replication: Replicated: clients get a copy, and changes the server makes reach them.
Put a PointLight directly inside a BasePart: lights anywhere else don’t shine. The light moves with its part.
Properties
Section titled “Properties”Type: Color3 · Default: Color3.fromHex('#ffffff') · Access: read/write · Replicates: yes
The light’s color.
brightness
Section titled “brightness”Type: number · Default: 1 · Range: 0 to 20 (clamped) · Access: read/write · Replicates: yes
How strong the light is.
Type: number · Default: 16 · Range: 0 to 200 (clamped) · Access: read/write · Replicates: yes
How far the light reaches, in studs.
enabled
Section titled “enabled”Type: boolean · Default: true · Access: read/write · Replicates: yes
Turns the light on and off.
Inherited from Instance: name, archivable, id, className, parent, destroyed
Methods
Section titled “Methods”Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString
Events
Section titled “Events”Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged
Examples
Section titled “Examples”A blinking lamp
Section titled “A blinking lamp”import { Color3, Part, PointLight, RunService, Vector3, workspace } from '@rally/sdk';
const lamp = new Part();lamp.shape = 'sphere';lamp.size = new Vector3(1, 1, 1);lamp.position = new Vector3(0, 8, 0);lamp.material = 'neon';lamp.parent = workspace;
const light = new PointLight();light.color = Color3.fromHex('#ffd23f');light.range = 24;light.parent = lamp;
let elapsed = 0;RunService.heartbeat.connect((dt) => { elapsed += dt; light.enabled = Math.floor(elapsed * 2) % 2 === 0; // on and off twice a second});