# 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: 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.sandbox.game/en/creator/game-maker/docs/components/triggers/switch.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.
