---
title: "Visual Scripting Events"
description: "Custom events are typed room-local messages routed by Runtime. They are the right tool when one script needs to notify another script about gameplay that already happened, such as a pickup collected, a hit applied, or a timer phase entered."
engineVersion: v1.0.234
date: 2026-09-28
license: "(c) Gessa, proprietary. Cite with attribution to https://gessa.ai/docs/. Terms: https://gessa.ai/terms/."
canonical: https://gessa.ai/docs/creator/visual-scripting-events/
---
# Visual Scripting Events

Custom events are typed room-local messages routed by Runtime. They are the
right tool when one script needs to notify another script about gameplay that
already happened, such as a pickup collected, a hit applied, or a timer phase
entered.

## Authoring

- Create custom events in the Events panel.
- Add typed payload parameters to document the event data.
- Use Event Dispatch nodes to emit events.
- Use Event Receive nodes or an `onCustomEvent` handler to react to events.

## SDK Access

Generated scripts emit custom events through the single room-local event atom:

```ts
ctx.events.emit("powerup.spawned", {
  entityId: "pickup_1",
  type: "speed"
});
```

During custom-event dispatch, the runtime calls `onCustomEvent`; match on the
event key before handling the payload:

```ts
export function onCustomEvent(ctx, event) {
  if (event.eventKey !== "powerup.spawned") return;
  ctx.log("info", "Powerup spawned", event.payload);
}
```

Cross-entity and cross-script emit use the same Runtime event router:

```ts
ctx.events.emit("round.started", { round: 2 });
```
