This is a template with Airlock, door, actiontrigger, and progressbar scripts.
The template is included to see a working airlock for underwater.
Howto use from scratch:
Create two doors
- attach the door script
- set the startState for each door
Create a trigger on one door/hatch
- attach actionTriggerScript
- attach airlockCycleScript
- copy to other door/hatch after configured and adjust for locator
- set actionPress to the airlockCycleScript
- set buttonToPress to interact (or whatever you like)
- set promptMessage to Cycle Airlock (or whatever you like)
hatch progressBar Script
- set a locator on each door
- uncheck visible (it will toggle on when script runs) or change as desired.
- place progressBarUiScript on locator
- place progressBarUI widget on locator
- set Quality to medium
- set size to 200 x 300 or whatever works best for said project
- see Progress Bar package write-up for more info (if desired)
airlockCycleScript (hatch is a navy term)
- set hatchA to the first door entity (drag and drop or dig through menu)
- set harchB to the second door entity
- set opening and closing sounds as desired
- set buffer sound if the sound needs to start before the door animation
- set hatchDelay before flooding compartment
- set floodEnable to actually flood the compartment (uncheck if no flooding)
- set floodEntity to the voxelMesh to move into the compartment
- set cycleProgressBar to the locator for the door/hatch
- set cycleTime to whatever time in seconds to move the voxelMesh
- set cycleVector the distance to move object (x, y, z) (z is up and down)
- set cycleSound to play while moving voxelMesh (a loop is best)
- set mode
- if you know what you are doing.
- see moveAndRotate Package / Tutorial for further info.
It is commented for future me to look at and see what did what.
- use as is
- use a guide to make a double door lever or trigger
- use as a space port hatch for cargo bays