# Events

Events trigger when state machine states change. Use these in Trigger nodes or Game Creator 2 Triggers to react to changes.

## Available Events

| Event                                                                                                                               | Description                                            |
| ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| [**On State Machine Variable Change**](/game-creator-2/state-machine-2/visual-scripting/events/on-variable-change.md)               | Fires when a State Machine Asset variable is modified  |
| [**On State Machine Runner Variable Change**](/game-creator-2/state-machine-2/visual-scripting/events/on-runner-variable-change.md) | Fires when a State Machine Runner variable is modified |

## Usage Example

```
Trigger Node:
├─ Event: On State Machine Runner Variable Change
│   ├─ Variable: "Health"
│   └─ Runner: Self
└─ Output → Actions: Update Health UI
```

{% hint style="success" %}
Variable change events are perfect for creating reactive UI that updates automatically when game state changes.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ninjutsugames.com/game-creator-2/state-machine-2/visual-scripting/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
