📚
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 Triggers

PreviousIntroductionNextRaycast Triggers

Last updated 4 years ago

Was this helpful?

Use this component to create player interaction with the trap. You can create trigger zones that activate the trap when the player enters, such as a pressure plate. You can use this component in a more advanced way, like using a disarm box when the player presses the E key.

This component depends on a Collider, with the isTrigger parameter enabled.

  • Trap: drag and drop the trap that this trigger manipulates.

  • Action: you can activate, deactivate the target trap, or toggle between these two states.

  • Cooldown: how many seconds before the trigger would work again.

  • Tag: only trigger when a game object with one of these tags enter. In most cases, this will be the Player.

  • Events: You can use these events to make visual effects for the trigger or show/hide a UI element.

You can use this component without a trap, but currently, only the Activate and the Deactivate actions are supported.

Interaction: You can allow the player to execute an action by pressing a button while staying in the trigger area instead of just walking into it. You can use or .

Key Codes
Unity Input