# The Event component

!!! note "Summary"
    The **Event** component holds Triggers that decide when logic runs and Instructions that define what happens. When any Trigger fires, the Event executes its Instructions from top to bottom.

![Event component example](assets/event-empty.jpg)

Add one with `Add Component` &rarr; `Visual Script` &rarr; `Event`. The Event component itself doesn't require a model or collider, though individual Triggers may need other components.

## Anatomy

The Event component has two lists:

| Section | Contains |
| :--- | :--- |
| **Triggers** | Any number of Triggers. The Instructions run when any one fires, as long as the Event isn't already running. |
| **Instructions** | An ordered list of Instructions, executed sequentially. |

![Event component example](assets/event.jpg)

You can drag entries to reorder either list, and copy and paste entries between Events.

Every entry describes itself in one line, so a whole Event reads top to bottom like a paragraph: *On Start, Log Hello World!* This exposes the configured behavior without expanding every field.

## Several Events on one object

A game object can hold several Event components. Give each behavior its own Event when you need to read, change, or disable it independently.

!!! example "Separate Events can be disabled independently"
    A door might have three Events: one opens it when the player is near, one plays a creak, and one locks it when a quest completes. Each Event can be read and disabled independently.

## Lifecycle

An Event follows the enclosing game object's lifecycle:

| Moment | What happens |
| :--- | :--- |
| **Awake** | Triggers are given their context and prepared. |
| **Enable** | Triggers start listening. |
| **Disable** | Triggers stop listening, and any Instructions currently running are canceled. |
| **Destroy** | Triggers are torn down and released. |

Disabling an **Event** component stops its sequence, including during a wait. If an Event is halfway through a five-second wait when its object is disabled, the rest of the list doesn't run.

That makes the enabled checkbox a reliable switch for turning a behavior off — during a cutscene, while a menu is open, or when a character dies.

## Running an Event from elsewhere

You can also run an Event directly from another Instruction. This lets you share a sequence between several places without duplicating it.

An Event with no Triggers is valid and provides a reusable routine. Give it a descriptive name, add its Instructions, and call it from another Event.

## What happens while it runs

An Event that's already running doesn't start again from the top. If a Trigger fires during the sequence, the Event ignores that firing rather than queuing it.

This prevents a door from starting its opening sequence again while it's already opening. Check the Event's running state when a Trigger appears to fire less often than expected.

To interrupt a running Event on purpose, use the **Cancel Event** Instruction. See [Instructions](instructions.md#canceling).

## Try it

* Add a second Event to the same object and give it a different Trigger. Confirm the two run independently.
* Give an Event two Triggers and watch the Instructions run when either fires.
* Start a long **Wait for Seconds** and disable the component mid-wait. Nothing below it runs.
* Make an Event with no Triggers, then run it from another Event.

## Where to go next

<div class="grid cards" markdown>

- **[Triggers](triggers.md)** — choose what an Event listens for and which object it observes.
- **[Instructions](instructions.md)** — understand sequential execution, waiting, and cancellation.
- **[Control flow](control-flow.md)** — branch, loop, wait, and exit using Conditions.
- **[Source & Target](source-target.md)** — follow the context that flows through an Event.

</div>
