> For the complete documentation index, see [llms.txt](https://docs.meshmap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.meshmap.com/unity-sdk/building-blocks/events.md).

# Events

The **Events** system defines modular gameplay triggers that can be configured in the editor.

## Event Types

### Repeatable Events

* Executes logic each time it is activated.
* Examples:
  * [**ShowObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Repeatable/Trigger/ShowObjectsTriggerEvent.cs) – Shows objects while inside the bounds of a trigger `Collider`. For example, to show decorative `GameObject`s that should only be visible when the player is nearby during a location-based experience.
  * [**PlayAudioTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Repeatable/Trigger/PlayAudioTriggerEvent.cs) – Plays an audio clip while inside the bounds of a trigger `Collider`. Requires an `AudioManager` in the scene and an `AudioRegistry` in a Resources folder. For example, to play narrative audio as a player walks around a self-guided AR tour.

### Completable Events

* Executes logic once when activated and marks it as complete.
* Implements `ISaveable` to optionally make the `CompletableEventState` persist across app launches using the [Save System](https://docs.meshmap.com/unity-sdk/building-blocks/save-system) feature.
* Examples:
  * [**SpawnObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Completable/Trigger/SpawnObjectsTriggerEvent.cs) – Spawns objects at intervals upon entering the bounds of a trigger `Collider`. For example, to spawn enemy `GameObject`s that a player must defeat in a location-based AR game.
  * [**SwitchObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Completable/Trigger/SwitchObjectsTriggerEvent.cs) – Switches the active/inactive states of objects upon entering the bounds of a trigger `Collider`. For example, to swap the content that is shown along the return path of a location-based AR tour experience.

## Prefabs

Ready-to-use examples with placeholder objects assigned for **ShowObjectsTriggerEvent**, **SpawnObjectsTriggerEvent**, and **SwitchObjectsTriggerEvent**.

{% embed url="<https://youtu.be/qxqGBvJandM>" fullWidth="false" %}
ShowObjectsTriggerEvent.prefab
{% endembed %}


---

# 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.meshmap.com/unity-sdk/building-blocks/events.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.
