> For the complete documentation index, see [llms.txt](https://speedtutoruk.gitbook.io/themedkeysystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://speedtutoruk.gitbook.io/themedkeysystem/getting-started/detailed-setup.md).

# Detailed Setup

## Quick Tips & Troubleshooting

{% hint style="info" %}
**QUICK START:** You can add the **Emblem Demo Scene** to your scene and it will have all the system setup and ready to use&#x20;
{% endhint %}

### TextMeshPro Required

{% hint style="info" %}

* Please note that TMP will appear as a popup if not installed in your project
* Click **Import TMP Essentials** to use the system fully
  {% endhint %}

### Tags & Layers Reference

{% hint style="info" %}
**Player:**&#x20;

* Layer of: **Ignore Raycast**

**Any Interactable Object:**

* Tag **InteractiveObject** or as per the raycast script on the main camera, it will have the tag you need!
  {% endhint %}

## System Setup

### Step 1 - Setting Up The Player

{% hint style="info" %}

1. When starting your new project please import an **FPSController** into your project. (Add an **FPSController** prefab to your scene.)
2. You can add the **EmblemInteractor** script to either the main camera or the main player object.
   1. **Interact Distance:** The distance you can interact with an object
   2. **Interact Key:** Set the key input from the system
   3. **Tag:** InteractiveObject is the tag used in the system
      {% endhint %}

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

### Step 2 - Adding the Managers

{% hint style="info" %}
Now drag the managers (from the **Prefabs** folder into the hierarchy)

1. **EmblemUIManager**
2. **EmblemAudioManager**
3. **EmblemInventoryManager**

**NOTE: Only drag this prefab into the hierarchy, not the scene**
{% endhint %}

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

### Step 3 - UI Manager Setup

{% hint style="info" %}

1. Select the **UI Manager** - which will have the **EmblemUIManager** script and make sure all the items are connected

All UI objects will be below this parent in the canvas
{% endhint %}

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

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

| Fields                      | Description                                                       |
| --------------------------- | ----------------------------------------------------------------- |
| **Slot Prefab**             | Add the **Inventory Slot** prefab from the prefab folder          |
| **Inventory Panel**         | Add the **Inventory Container** from the **Key Inventory Canvas** |
| **Inventory Fade Duration** | Set the fade time before opening or closing the inventory         |
| **Crosshair**               | Add the UI - Crosshair UI object                                  |
| **Persistence**             | Set whether you want to keep this between scenes                  |

### Step 4 - Inventory Canvas Setup

{% hint style="info" %}

1. The Key Inventory Canvas is a child of the UI Manager

The system uses a **CanvasGroup** on the main Canvas object which controls how to show and display the UI. It will fade the canvas in and out.
{% endhint %}

### Step 5 - Setting up the inventory

{% hint style="info" %}

1. Select the **EmblemInventory**
   {% endhint %}

{% hint style="info" %}
v1.5 now using a JSON save system and you can find more information [here](/themedkeysystem/getting-started/json-save-system.md)
{% endhint %}

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

### Step 6- Setting up the Audio Manager

{% hint style="info" %}

1. Select the **AudioManager** and add the ScriptableObjects for sounds you will have created. (The ScriptableObjects folder will have some examples)
   {% endhint %}

{% content-ref url="/pages/0hqXWg9omA7V7Wp6rgcx" %}
[Adding Audioclips](/themedkeysystem/support/adding-audioclips.md)
{% endcontent-ref %}

![](/files/t4SNvIKhiwN5cyOvrwva)

### Step 7 - Creating a Key Pickup

{% hint style="info" %}
You can add a key from the prefabs folder, all of the details should already be setup but check the details below to make sure.
{% endhint %}

{% hint style="info" %}
Setting up the a Key Collectable:

1. Tag: **InteractiveObject**
2. Add a **Box Collider**
3. Add a **EmblemItem** script to the object and set the **ItemType** to **Key**
4. Add a **EmblemKeyCollectable** script and add the appropriate ScriptableObjects and your desired ScriptableObjects audio clip. (Found in the ScriptableObjects folder)
   {% endhint %}

![](/files/S7M1ks9QmtW4hErJjHTl)

### Step 8 - Creating an interactive door

{% hint style="info" %}
You can add a door from the prefabs folder, all of the details should already be setup but check the details below to make sure.
{% endhint %}

{% hint style="info" %}
Setting up the a Interactive Door:

1. Tag: **InteractiveObject**
2. Make sure to add a **Box Collider**
3. Add a **EmblemItem** script to the object and set the **ItemType** to **Door**
4. Add a **EmblemDoorInteractable** script and add the appropriate ScriptableObjects and settings
5. Door Event can be [seen here](/themedkeysystem/support/unlock-event.md)
   {% endhint %}

![](/files/JaZXja1tvOT1dvjIlOMD)

|                      |                                                                                                                                                                  |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Remove Key After Use | Should the key be removed from the inventory after using it with the door?                                                                                       |
| Key Scriptable       | Add the key scriptable object that is specific for this door                                                                                                     |
| Animated Door Key    | Add the animated key which is parented to this asset                                                                                                             |
| Sounds               | Add the sound SO's that are in the screenshot below                                                                                                              |
| Key Audio Delay      | The delay before the audio for key insert will play. Default: 0.5 seconds                                                                                        |
| Door Open Delay      | The delay before the door opening sound will play. Default: 1.5 seconds                                                                                          |
| Animation Event      | The event which happens when the key is inspired, so in my demo this plays the animation from the **EmblemDoorController** script which is on the prefab object. |
