Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Runtime classClient APIGenerated

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.

destroy(): void

Defined in: client/api.d.ts:1657

Removes this client-local light. Safe to repeat.

void


static spawn(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.

Vector3 | { x: number; y: number; z: number; }

World-space position in metres.

Defaults to warm orange, intensity 1, radius 5 and shadows off.

boolean

Vector3 | { x: number; y: number; z: number; }

number

number

Light

The new local light handle.

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.


readonly id: number

Defined in: client/api.d.ts:1622

Client-local service handle, distinct from server network entity identifiers.


intensity: number

Defined in: client/api.d.ts:1642

Diffuse intensity multiplier, from 0 to 100.


position: Vector3

Defined in: client/api.d.ts:1632

World-space position in metres. Invalid positions throw before mutation.


radius: number

Defined in: client/api.d.ts:1647

Light radius in metres, from 0.1 to 100.


readonly valid: boolean

Defined in: client/api.d.ts:1627

Whether the native light still exists. False after destruction, resource cleanup or a world change.