Skip to content

PointLight

A light that shines in every direction from the part it’s in.

  • Inherits: Instance
  • Creatable: Yes: new PointLight(), or Instance.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.

Type: Color3 · Default: Color3.fromHex('#ffffff') · Access: read/write · Replicates: yes

The light’s color.

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.

Type: boolean · Default: true · Access: read/write · Replicates: yes

Turns the light on and off.

Inherited from Instance: name, archivable, id, className, parent, destroyed

Inherited from Instance: getPropertyChangedSignal, setAttribute, getAttribute, getAttributes, getAttributeChangedSignal, getChildren, getDescendants, findFirstChild, findFirstChildOfClass, findFirstChildWhichIsA, findFirstAncestor, findFirstAncestorWhichIsA, waitForChild, isA, isDescendantOf, isAncestorOf, getFullName, clearAllChildren, destroy, clone, toString

Inherited from Instance: changed, childAdded, childRemoved, descendantAdded, descendantRemoving, ancestryChanged, destroying, attributeChanged

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
});