Detailed Setup
Quick Tips & Troubleshooting
QUICK START: You can add the Safe Demo Scene Prefab to your scene to get everything setup and ready to go without having to follow any extra steps.
Tag Setup
Your Safe Model will need a tag of:
InteractiveObject (This can be changed in the SafeInteractor script)
FPS Controller usage
When starting your new project you'll need to use a character controller you wish - I have included my STFPSController for ease of use
Canvas Group Note
The Safe - Canvas under the Safe UI Manager - Uses a Canvas Group which has an Alpha or 0 - 1, use this to enable or disable the visual look of the UI elements.
System Setup
Step 1 - Adding Player & Raycast
Add an FPS Controller to your scene. (Unless you’re using the demo).
Make sure your Main Camera has the SafeInteractor on it. (This Raycast script could go on any object but the Main Camera is always easily found.
Make sure your Main Camera has the tag of: MainCamera
Set the Ray Distance
Set the Interaction Tag
And Input for the opening of the safe
Step 2 - Adding UI Manager
Add a UIManager – Which will include the specific children:
Safe - Canvas (Make sure this entire object is turned off at the start)
InteractPrompt - Canvas
UI - InteractPrompt (Make sure this object is turned off at the start)
Crosshair - Canvas
EventSystem
Select the UIManager object and look at the Safe UI Manager script. You will need to have UI references as below:
Step 3 - Adding Disable Manager
Add a DisableManager from the prefabs folder and add custom events for disabling your player, crosshairs and more. See more information below on exactly how to use the disable manager or shoot me an email!
Step 4 - Adding Audio Manager
Add the AudioManager from the prefabs folder and add all ScripableObject objects from the ScriptableObjects folder. These can be in any order:
Step 5 - Adding a Safe
Place the Raycast Safes or Trigger Safes prefab from the Prefabs folder into your scene.
The Raycast Safes should have children of different colours, each colour will be split into their children:
Safe - Model - Make sure this object has a:
Box Collider
SafeItem: Add the safe controller object to this slot
Tag: Make sure it has the tag of InteractiveObject
Step 6 - Setting up Safe Controller
Safe Controller: Should have a SafeController script added with the slots needed to be filled below
Safe Model
Add your safe model to this slot
Door Transform
Add the safe door model to this slot
Handle Transform
Add the safe handle to this slot
Safe Dial
Add the Safe - Dial model to this slot
Animation Timers
These are the timers before starting the handle spin or door opening. Defaults are a good set of basic values
Handle Spin Settings
This is how fast and long the handle will spin for. Default settings are a good start
Door Open Settings
This is the direction and speed the safe door will open
Safe Solution 1-3
A number from 0-15 for each of these solutions
Close Safe Key
The interaction key for legacy input
Unity Events
This is a UnityEvent to add custom functionality when it’s opened
Is Trigger Interaction
Set this to True if you’re using a trigger event
Trigger Object
Add the trigger event to this slot
Step 7 - Spawning Items & Fixing Interaction Issues
You can spawn objects using the Safe Opened event, as you can see from the example below. The Spawnable objects are set to false
To avoid interaction issues we disable the default entire model collider and enable a set of skeleton colliders that allow inside interaction
You can also see the Unlock Event page below for more information
Last updated