📚
Deadly Dungeons
  • Initial page
  • Traps
    • Introduction
    • Trap Triggers
    • Raycast Triggers
    • Disabling Traps with Triggers
    • Trap
    • Trap Mechanism
      • Animator
      • Launcher
      • Particle (Trap Mechanism)
      • Physics
    • Effect Handlers
      • Audio Handler
      • Particle (Effect Handler)
      • Ray Handler
      • Custom Effect Handler
    • Damage System
      • Damage Source
      • IDamageable
      • Damage Result
    • Damageable Example
    • Utility
      • AutoConnect Joint
      • Texture Mover
Powered by GitBook
On this page

Was this helpful?

  1. Traps

Trap

PreviousDisabling Traps with TriggersNextTrap Mechanism

Last updated 4 years ago

Was this helpful?

This component organizes the different 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.

// 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()                

mechanisms