Skip to main content
The Signals namespace is how you broadcast messages between entities in the level. A signal carries an identifier string and optional data payload; any entity that listens for that identifier will receive the signal and can act on it. You choose the delivery scope — all entities, a single target, a tag group, a type group, or entities that pass a custom filter function.

Functions

emit

Dispatches a pre-built Signal object, or constructs one inline from a property table.
The table form lets you build and emit in a single expression:

emitToAll

Broadcasts a signal to every entity in the level, optionally with a data payload.

emitTo

Sends a signal to a single specific entity.

emitToTag

Sends a signal to every entity that carries the given tag string.

emitToType

Sends a signal to every entity of a given EntityType.

emitToTypeAndTag

Sends a signal to every entity that matches both the given type and tag.

emitToCustom

Sends a signal to every entity for which customFilter(entity, signal) returns true.

Signal Class

You can construct a Signal object manually when you need full control over all delivery options. Pass it to Signals.emit().

Properties

Signal.new

The table-constructor form is the most common approach. All fields except id are optional:

Usage Examples

Broadcast to all entities

Target a specific entity

Notify all entities sharing a tag

Filter by type and tag together

Custom filter