Basic Scripts Description

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"
openingAnimation: AnimationClip;
openingSound: AudioClip;
closingSound: AudioClip;
unlockingSound: AudioClip;
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