# Door

{% 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" %}
**GAME MAKER 0.9 ENHANCEMENT**

Instead of triggering a door to open or close with the same message(s), a door can now be triggered with different open and close messages.
{% endhint %}

<figure><img src="https://4251931498-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MO_j99BJEXK4zHqxgqS%2F-MOymmav5l4VAuhKdgpS%2F-MOynmzEa6E6UJLuUPXm%2FDoor.gif?alt=media&#x26;token=295c2e52-23bb-4394-8e08-6eb774fe735b" alt=""><figcaption></figcaption></figure>

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

{% hint style="success" %}
**USE THE RIGHT TOOL FOR LOGIC STATES**

A new <mark style="color:green;">**\[SP]**</mark> and <mark style="color:yellow;">**\[MP]**</mark> [**Switch**](https://docs.sandbox.game/en/creator/game-maker/docs/components/triggers/switch) component can be used to trigger two states and send a message for each state.

Previously, **Door** behaviour was used for this. It is now only available as <mark style="color:yellow;">**\[MP]**</mark> because a <mark style="color:green;">**\[SP]**</mark> version of **Door** behaviour would cause collision issues in multiplayer games.
{% endhint %}

## ![](https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FslYirEH1bfzUA2tKTJAu%2Fimage.png?alt=media\&token=fac95704-f1bb-4d86-af60-32e4d1481abe) Door <mark style="color:yellow;">\[MP]</mark>

* Rotate the Object 90 degrees or set any of the Object's built-in animations to play for "Open" and "Close" states
* "Open" mode temporarily removes the Object's collisions
* Interact or use any message to trigger a door to open and any message to trigger it to close (collecting a key, detecting a pickable key, etc)

## Communications

<table data-header-hidden><thead><tr><th width="328"></th><th></th></tr></thead><tbody><tr><td><p><strong>Inputs:</strong></p><p>Player Interaction<br>One or more Messages to open<br>One or more messages to close</p></td><td><p><strong>Outputs:</strong></p><p>Play animation, Message sent on Open<br>Play animation, Message sent on Close<br>OR<br>Rotate 90 degrees and back</p></td></tr></tbody></table>

## Common Uses

* Simple door with Interaction
* Intermediate to advanced door logic sequences for dungeons or puzzles
* Rotating an Object 90 degrees

## Parameters

| Options                                                                                                                                                                                                                                                   | Details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://331512196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F83PS3g9zpWmq73xzlwFn%2Fuploads%2FWQ73qV7HkW0SDrZhnefZ%2Fimage.png?alt=media&#x26;token=e2025444-cdd0-4084-8331-43f671f892a5" alt="" data-size="original"> | <p><strong>Message Required to Open</strong> - one or more messages can trigger the door to open<br><br><strong>Message Required to Close</strong> - one or more messages can trigger the door to close</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/g42QgoRM5hUIAuUab4GR/image.png)                                                                                                                                                        | <p><strong>Opening Mode</strong></p><ul><li><strong>Rotate</strong> - rotates the object with Door behaviour 90 degrees when opened and back when closed</li><li><strong>Animate</strong> - plays door animations when messages trigger a change in state</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/EwH9vJFl3MEXDTF9iFHn/image.png)                                                                                                                                                        | <p><em><mark style="color:green;"><strong>Opening Animation</strong></mark></em> - select the asset's animation you wish to display when you trigger the door to open with message<br><br><em><mark style="color:green;"><strong>Closing Animation</strong></mark></em> - select the asset's animation you wish to display when you trigger the door to close with message</p>                                                                                                                                                                                                                                                                                                        |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/tyP3SuFvoKQylQnQL0XG/image.png)                                                                                                                                                        | **Starting State** - set the state of the Object as Closed or Opened at the start of the Experience.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/uKG2XwB2GD9EyGWxvfDa/image.png)                                                                                                                                                        | <p><strong>Message on Open</strong> - a message sent when the door opens<br><br><strong>Message on Close</strong> - a message sent when the door closes</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ![](https://content.gitbook.com/content/83PS3g9zpWmq73xzlwFn/blobs/tZQF1kccyNiUQJpUzMvq/image.png)                                                                                                                                                        | <p><strong>Broadcast Type</strong></p><ul><li><strong>All</strong> - all actors and systems</li><li><strong>Everyone in Range</strong> - all actors in range</li><li><strong>Specific Tags in Range -</strong> all actors in range with specific tags</li><li><strong>Selected Actors -</strong> specific actors in the Experience</li><li><strong>Rules -</strong> the Game Rules system</li><li><strong>Objectives -</strong> the Quest system</li><li><strong>Self -</strong> this object</li></ul><p><em><mark style="color:green;"><strong>Broadcast Range</strong></mark></em> (slider) - move the slider or enter a distance in blocks from the anchor point of the object</p> |
