# Trap

![](/files/-MW52yrB3TICfe0xbU26)

This component organizes the different [mechanisms](/traps/trap-mechanism.md) into a single trap and activates them when it is triggered.

![](/files/-MW-m8FocT-hllABncHj)

* **Start Mode:** Selecting the OnAwake option will automatically activate the trap when the game starts. OnEvent allows you to activate with a TrapTrigger or directly from a script.
* **Sync:** Uncheck this option to set an activation delay for each mechanism.
* **Mechanism:** You can add or remove as many mechanisms as needed.

You can access the following methods and parameters from the code.

```csharp
// Returns if the trap is currently active or not.
bool isActive { get; }    

// Activates the trap if Start Mode is set to OnEvent.
void Activate()     

// Inactivates the trap.
void Deactivate()

// Toggles between active and inactive states. 
// Can only activate if Start Mode is set to OnEvent.            
void Toggle()                
```


---

# 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://traps.runemarkstudio.com/traps/trap.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.
