> For the complete documentation index, see [llms.txt](https://docs.sandbox.game/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sandbox.game/en/creator/game-maker/docs/components/triggers/switch.md).

# Switch

{% hint style="success" %}
**COPY/PASTE PARAMETERS**

New in GM 0.11! Right click on a behaviour or component to copy. Then open an object, add the same behaviour or component, and right click it to paste identical parameter settings.
{% endhint %}

{% hint style="info" %}
**NEW GAME MAKER 0.9 FEATURE**

Create new types of puzzles where two states of a message would be needed, such as a lever code.
{% endhint %}

<figure><img src="/files/HNN1HpuS7gNsLVatGkmU" alt=""><figcaption><p>Shown: The <strong>Switch</strong> component's states can trigger doors, platforms, VFX, and more. <br>To visualise states A and B, Animated Decoration behaviour displays a lever in on/off positions.</p></figcaption></figure>

{% hint style="info" %}
[Build Singleplayer & Multiplayer Logic](/en/creator/game-maker/docs/build-singleplayer-and-multiplayer-logic.md) - about <mark style="color:green;">**\[SP]**</mark> or <mark style="color:yellow;">**\[MP]**</mark> behaviours or components
{% endhint %}

## <img src="/files/xFdL7uKLguO6HTGWTjWK" alt="" data-size="line"> Switch  <mark style="color:green;">\[SP]</mark> <mark style="color:yellow;">\[MP]</mark>

When a state (A or B) is triggered, send a specified message.

## Common Uses

* Create logic for puzzles with two different types of messages
* Avoid using Door behaviour, which is only available in \[MP], to send messages to \[SP] and \[MP] objects depending on the state of the door (opened/closed).
* Communicating messages to the Rules system when an object's state is triggered.

## Communications

|                                                                 |                                                               |
| --------------------------------------------------------------- | ------------------------------------------------------------- |
| **Inputs:** One or more messages to trigger each state (A or B) | **Outputs:** One message out depending on the state triggered |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.sandbox.game/en/creator/game-maker/docs/components/triggers/switch.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
