# Detailed Setup

## Quick Tips & Troubleshooting

{% hint style="info" %}
**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.
{% endhint %}

### Tag Setup

{% hint style="info" %}
Your Safe Model will need a tag of:

* **InteractiveObject** (This can be changed in the **SafeInteractor** script)
  {% endhint %}

### FPS Controller usage

{% hint style="info" %}
When starting your new project you'll need to use a character controller you wish - I have included my **STFPSController** for ease of use
{% endhint %}

### Canvas Group Note

{% hint style="info" %}
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.
{% endhint %}

## System Setup

### Step 1 - Adding Player & Raycast

{% hint style="info" %}

1. Add an **FPS Controller** to your scene. (Unless you’re using the demo).&#x20;
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.&#x20;
   1. Make sure your **Main Camera** has the tag of: **MainCamera**
   2. Set the **Ray Distance**&#x20;
   3. Set the **Interaction Tag**
   4. And Input for the opening of the safe
      {% endhint %}

<figure><img src="/files/QUHNaJQmgVcDp1plYjj6" alt=""><figcaption></figcaption></figure>

### Step 2 - Adding UI Manager

{% hint style="info" %}

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
      {% endhint %}

<figure><img src="/files/aq99GtVyhKMwGmSvMrO4" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
2\. Select the **UIManager** object and look at the **Safe UI Manager** script. You will need to have UI references as below:
{% endhint %}

<figure><img src="/files/HN5BzrjrBdZzOU77e653" alt=""><figcaption></figcaption></figure>

### Step 3 - Adding Disable Manager

{% hint style="info" %}

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!
   {% endhint %}

{% content-ref url="/pages/rZGYv7p17wvJdoDzobV2" %}
[Disable Manager Explained](/safe-system-doc/managers-explained/disable-manager-explained.md)
{% endcontent-ref %}

### Step 4 - Adding Audio Manager

{% hint style="info" %}
Add the **AudioManager** from the prefabs folder and add all ScripableObject objects from the **ScriptableObjects** folder. These can be in any order:
{% endhint %}

![](/files/iB8OS9BEUXhWXpLbI34x)

### Step 5 - Adding a Safe

{% hint style="info" %}

1. Place the **Raycast Safes** or **Trigger Safes** prefab from the **Prefabs** folder into your scene.&#x20;
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**
         {% endhint %}

![](/files/C5uMhwWI5ZXhMIueUEWf)

### Step 6 - Setting up Safe Controller

{% hint style="info" %}
**Safe Controller:** Should have a **SafeController** script added with the slots needed to be filled below
{% endhint %}

<figure><img src="/files/7YeSR5rvq1T4Ex1btcm7" alt=""><figcaption></figcaption></figure>

| 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

{% hint style="info" %}

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
{% endhint %}

{% content-ref url="/pages/Ij3CGEG1FZNZoLShHtJQ" %}
[Unlock Event](/safe-system-doc/support/unlock-event.md)
{% endcontent-ref %}

<figure><img src="/files/6WeqUrdotwWGJq5HbWZg" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://speedtutoruk.gitbook.io/safe-system-doc/getting-started/detailed-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
