> 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/button.md).

# Button

This legacy behaviour was moved to a component in Game Maker 0.10 for to improve interconnection of logic. Documentation is being updated.

{% 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 %}

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MOyWCaDbpbTaQAQImOD%2F-MOyX6hM4nAwzqmch48j%2FButton.gif?alt=media&#x26;token=845ad09a-6b58-4f21-80e7-45b1483ed0bf" alt="" data-size="original"></td><td>Send a message when a player interacts with an object.</td></tr></tbody></table>

{% 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 %}

{% hint style="success" %}
**USAGE TIP**\
**Button** component has a cooldown parameter, **Duration**, to prevent players from spamming logic triggers. Use this when you want logic to stay active, but not be triggered excessively at once.
{% endhint %}

## <img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FTrJb8sNlFMv5SJyD9Q2U%2Fimage.png?alt=media&amp;token=b3f270f3-a39d-40d9-8c93-06e8c8dc07f9" alt="" data-size="line"> Button <mark style="color:green;">\[SP]</mark> <mark style="color:yellow;">\[MP]</mark>

Interacting with this button will send a message to all assets within its broadcast range.

## Common Uses

* Send a message to another Object's Toggle Component to activate or deactivate its Behavior (e.g., Platform, Melee Enemy, etc) for a puzzle platformer
* Apply to Assets such as info panels and trigger the NFT Details Display Component, open doors from a distance, etc.
* Trigger lights and/or sound to turn on/off
* Reset logic on a Multiplayer Experience

## Communications

<table data-header-hidden><thead><tr><th width="278"></th><th></th></tr></thead><tbody><tr><td><p><strong>Inputs:</strong></p><p>Player Interaction (Press E)</p></td><td><p><strong>Outputs:</strong></p><p>Send one message within a specified range</p></td></tr></tbody></table>

<img src="https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/OFPuybl7IfzhVkM06Hcq/file.excalidraw.svg" alt="" class="gitbook-drawing">

## Parameters

| Options                                                                                            | Details                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/G1XzZ8dpQ6hRa4qvJOmK/image.png) | **Message to Send** - set a Message to send when players press E and interact with this Object                                                                                                                                    |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/qlnUzryRrqy1DHrOlFgK/image.png) | <p><em><mark style="color:green;"><strong>Broadcast Range</strong></mark></em> - set the distance the Message will reach<br><br>This parameter is visualised with a yellow circle Gizmo that adjusts as you change the value.</p> |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
