Light
Defined in: client/api.d.ts:1616
A point light created on this client. Not replicated; server scripts can use events to coordinate local lights, or the server Light API for persistent replicated lights.
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: client/api.d.ts:1657
Removes this client-local light. Safe to repeat.
Returns
Section titled “Returns”void
spawn()
Section titled “spawn()”
staticspawn(position,options?):Light
Defined in: client/api.d.ts:1665
Creates a client-local point light until destroyed, its creating resource stops or errors, or the session/world ends. Throws when the world is unavailable, native creation fails or the shared 192-light budget is full.
Parameters
Section titled “Parameters”position
Section titled “position”Vector3 | { x: number; y: number; z: number; }
World-space position in metres.
options?
Section titled “options?”Defaults to warm orange, intensity 1, radius 5 and shadows off.
castShadows?
Section titled “castShadows?”boolean
color?
Section titled “color?”Vector3 | { x: number; y: number; z: number; }
intensity?
Section titled “intensity?”number
radius?
Section titled “radius?”number
Returns
Section titled “Returns”Light
The new local light handle.
Properties
Section titled “Properties”castShadows
Section titled “castShadows”castShadows:
boolean
Defined in: client/api.d.ts:1652
Whether to cast native shadows. False by default; rendering also depends on the game’s shadow settings.
color:
Vector3
Defined in: client/api.d.ts:1637
RGB color using x, y and z, each from 0 to 1.
readonlyid:number
Defined in: client/api.d.ts:1622
Client-local service handle, distinct from server network entity identifiers.
intensity
Section titled “intensity”intensity:
number
Defined in: client/api.d.ts:1642
Diffuse intensity multiplier, from 0 to 100.
position
Section titled “position”position:
Vector3
Defined in: client/api.d.ts:1632
World-space position in metres. Invalid positions throw before mutation.
radius
Section titled “radius”radius:
number
Defined in: client/api.d.ts:1647
Light radius in metres, from 0.1 to 100.
readonlyvalid:boolean
Defined in: client/api.d.ts:1627
Whether the native light still exists. False after destruction, resource cleanup or a world change.