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

Canavs 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

  1. Add an FPS Controller to your scene. (Unless you’re using the demo).

  2. 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.

    1. Make sure your Main Camera has the tag of: MainCamera

    2. Set the Ray Distance

    3. Set the Interaction Tag

    4. And Input for the opening of the safe

Step 2 - Adding UI Manager

  1. Add a UIManager – Which will include the specific children:

    1. Safe - Canvas (Make sure this entire object is turned off at the start)

    2. InteractPrompt - Canvas

      1. UI - InteractPrompt (Make sure this object is turned off at the start)

    3. Crosshair - Canvas

    4. EventSystem

  1. 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

  1. 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!

Disable Manager Explained

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

  1. Place the Raycast Safes or Trigger Safes prefab from the Prefabs folder into your scene.

  2. The Raycast Safes should have children of different colours, each colour will be split into their children:

    1. Safe - Model - Make sure this object has a:

      1. Box Collider

      2. SafeItem: Add the safe controller object to this slot

      3. 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

Type
Description

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

  1. You can spawn objects using the Safe Opened event, as you can see from the example below. The Spawnable objects are set to false

  2. 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

Unlock Event

Last updated