# Trigger Area

To trigger an action when the player walks into or out of an area, use the Trigger Area [Smart Item](https://docs.decentraland.org/creator/scene-editor/interactivity/smart-items).

![](https://45449780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-649dfd99d06849f543399b5b89a6a31a015cb439%2Ftrigger.png?alt=media)

The orange cube you see while editing your scene is only visible in the Scene Editor, it becomes invisible when running a preview of the scene. You can easily adjust and scale the orange cube to cover exactly the area you need.

If any part of the player's body overlaps with this orange cube, the assigned event will be called.

Use the **On Player Enters Area** and **On Player Leaves Area** trigger types on the item's **Triggers** component. The actions on these trigger events are activated every time that the player enters or leaves the area.

![](https://45449780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-f8389cd077c495e0b8ada33ca0da01800eee7dcd%2Fon_player_enters.png?alt=media)

You can add as many different actions on the same trigger event, this will activate them all simultaneously.

{% hint style="info" %}
**💡 Tip**: If the trigger areas in your scene start getting in the way of editing other content, remember you can always lock and/or hide them from the [Entity Tree](https://docs.decentraland.org/creator/get-started/scene-editor-essentials#the-entity-tree).

<img src="https://45449780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-22638c584105c16e473cdbcab644d55b04540fc4%2Fhide-trigger.png?alt=media" alt="" data-size="original">
{% endhint %}

You can also add **Trigger conditions**, so that the actions are only carried out if certain conditions are met in the scene. For example, you could have a trigger area that opens a sliding door when the player walks in; you could use a condition there to check the state of a lever that acts as a power switch, and only open the door if the power is on. See [States and conditions](https://docs.decentraland.org/creator/scene-editor/interactivity/states-and-conditions) for more details.

![](https://45449780-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-7b4672a813859334f5951ee8c1e2d31a90509d32%2Ftrigger-conditions-trigger-area.png?alt=media)

Multiple trigger areas can overlap, and don't affect each other.

{% hint style="info" %}
**📔 Note**: You can also use **On Player Enters Area** and **On Player Leaves Area** trigger events on any other smart item, but keep in mind that it can be challenging to know the area covered by the trigger.

The size of the triggerable area doesn't relate to the item's visible shape or its colliders, it's always a cube of 1m on each side, affected by the scale of the item.
{% endhint %}


---

# 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.decentraland.org/creator/scene-editor/interactivity/trigger-area.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.
