> For the complete documentation index, see [llms.txt](https://docs.gamecreator.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gamecreator.one/game-creator/systems/event-system.md).

# Event System

Since version 0.9.1 **Game Creator** comes with a fully fledge **Event System** that is built on top of **Triggers** and **Actions** for maximum flexibility.

## Event System 101

When a game object (yellow) wants to communicate a state change to other game objects (blue ones) it normally has to iterate over all these objects and notify them one by one about the change.

![](/files/-Le6bTfxxg3Vgc1rjkO7)

This is okay for small scale and non-dynamic systems, but it can quickly become a mess. An **Event System** flips the system upside down, making objects *subscribe* to a proxy that observes the object with the state change, and communicates it when the change happens.

![](/files/-Le6cBVPX8HS3M3Ugrib)

By doing so we translate the responsibility of keeping a list of objects that need to be notified from the yellow object to each individual blue object.

## Dispatch an Event

To dispatch an **Event** all that is needed is to call the **Dispatch Event Action**. This **Action** needs a string field which is the **name** of the event.

![(A Dispatch Event Action using "my-event" as the name of the Event)](/files/-Le6i_9wXpWMvfRoE_2J)

{% hint style="info" %}
The name of the **Event** dispatched can be whatever the developer wants.
{% endhint %}

## Receive an Event

An object can listen to events dispatched using the **On Receive Event Trigger**. This **Trigger** will be called every time an event with a specific name is raised.

![(Trigger set to detect when a "my-event" Event is dispatched)](/files/-Le6kLvw7S2FuUtMvLPt)

Optionally, the invoker of this event can be saved in a **Variable** to lately reference the caller from within an **Action** or a **Condition**.
