Trap
This component organizes the different mechanisms into a single trap and activates them when it is triggered.
  • 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.
1
// Returns if the trap is currently active or not.
2
bool isActive { get; }
3
​
4
// Activates the trap if Start Mode is set to OnEvent.
5
void Activate()
6
​
7
// Inactivates the trap.
8
void Deactivate()
9
​
10
// Toggles between active and inactive states.Β 
11
// Can only activate if Start Mode is set to OnEvent.
12
void Toggle()
Copied!
​
Last modified 8mo ago
Copy link