Easy Doors, Chests and Traps


This is a light weight powerful system that helps you create functional doors, chests, traps etc inside Unity just within one minute.
It will help you create any kind of door (or similar triggered events) you need.

The system allows:

  • To control which objects can open the door or trigger a trap
  • Any custom animations to be assigned
  • Different sounds FX to be triggered according to actions
  • Lock door with custom code
  • Automatic opening, closing and/or locking
  • Button and object triggered actions
  • Integrated combination-lock etc to be assigned
  • etc

This system works on all platforms supported by Unity3D. 

How to use

To use this system – you should just:

  1. Create empty GameObject and add Collider(IsTrigger=true) and Rigidbody components to it

  2. Add Audio source if you’ll need sound FX

  3. Attach DoorController component and tune it as you want

  4. Attach door object(with Animation component) as child and set it as AnimatedObject in


  5. If you need combination-lock – attach CodeLock component as well and assign your Player

    to PlayerObject parameter

  6. If you want to have door unlocked by object that “know” code – attach CodeCard compo-

    nent to this object and specify code to door in it. 

DoorController script description

Main script that allows you to simulate doors, chest, caps and traps
Script supports different FXs (animations, sounds) and types of triggering (auto, by key, manually) Object can be locked and codded by some numeric pass-key

Average structure looks like: 

  • manualOpeningOnly - Allow only manual interaction by direct call of functions
  • FX - Special FX (animations, sounds) for this "door"
  1. openingAnimation: AnimationClip;
  2. openingSound: AudioClip;
  3. closingSound: AudioClip;
  4. unlockingSound: AudioClip;
  5. lockedSound: AudioClip;
  • animatedObject - Link to object that will be animated
  • allowedObjectsTags - List of tags of objects that can interact with (if empty - all objects are allowed)
  • locked - Is "door" locked
  • autoLock - Should be "door" closed automatically if no allowed objects in trigger
  • autoClosingTime - How fast should it be closed (if 0 - don't close automatically)
  • unlockingCode - Code for unlocking (if 0 - unlocked already)
  • openByKey - Key code to trigger action. If None - action will be triggered automatically 

CodeCard script description

Script allows lock/unlock Door by sending code to current DoorController component.
Code will be send to DoorController (automatically or by key pressing) when object will be in trigger zone

Average structure looks like: 

  • cardCode - Stored code
  • applyByKey - Key code to trigger action. If None - action will be triggered automatically
  • lockDoorOnExit- Will be door locked automatically when this object leave it trigger area 

CodeLock script description

Script allows to enter code and send it to current DoorController component Example visualisation of code-entering window included

Average structure looks like: 

  • doorController - DoorController attached to receive code
  • playerObject - Player object that will able to trigger code entering
  • applyByKey - Key code to trigger action. If None - action will be triggered automatically