> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/main-components/reactions/scriptable-reactions.md).

# Scriptable Reactions

Reactions that write to Scriptable Variable Listeners

Reactions that write a value into a **Var Listener** on a GameObject.

A Scriptable Variable is a shared asset. A **Var Listener** is the component that connects one specific GameObject to it. These reactions drive the listener, so the change is scoped to that object rather than applied globally.

***

| Reaction                                                                                                                                                  | Target             |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| [Set Bool Var Listener](https://malbersanimations.gitbook.io/animal-controller/main-components/reactions/scriptable-reactions/set-bool-var-listener.md)   | `BoolVarListener`  |
| [Set Float Var Listener](https://malbersanimations.gitbook.io/animal-controller/main-components/reactions/scriptable-reactions/set-float-var-listener.md) | `FloatVarListener` |
| [Set Int Var Listener](https://malbersanimations.gitbook.io/animal-controller/main-components/reactions/scriptable-reactions/set-int-var-listener.md)     | `IntVarListener`   |

All three behave identically apart from the value type.

***

## Two shared behaviours

**The search runs in both directions.** Each reaction collects listeners from the target's **parents and its children**, then merges the two lists. A listener anywhere in the hierarchy is found, above or below.

**ID `-1` means every listener.** Leave the ID at its default and every listener found is written to. Set a real ID to target one specific listener when an object carries several.

***

## Listener versus the variable itself

Writing the Scriptable Variable asset directly changes it for **everything** in the game that reads it. Writing through a listener changes it for **this object only**.

That distinction is the whole reason these reactions exist. Use them for per-object state; modify the asset directly only for genuinely global state.
