> For the complete documentation index, see [llms.txt](https://traps.runemarkstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://traps.runemarkstudio.com/traps/trap.md).

# 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()                
```
