> 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

{% 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="/files/LgBGTvmabjtQ54GJpHEU" 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="/files/SKGyQTppbelVbzkVql0J" alt="" class="gitbook-drawing">

## Parameters

| Options                          | Details                                                                                                                                                                                                                           |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/oFB58QFr8ILOZLHayYvm) | **Message to Send** - set a Message to send when players press E and interact with this Object                                                                                                                                    |
| ![](/files/kDJnrekHp8x50PhPSayy) | <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 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/button.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.
