# Detailed Setup

{% embed url="https://youtu.be/CapJzsYuIdY" %}

{% hint style="warning" %}
**NOTE:** You can get a quick start using the **Entire\_Fusebox\_DemoScene** prefab object and drag that straight into your scene. This will everyone to be already setup, you can delete the art assets as required but checkout the demo scene if you’re confused!
{% endhint %}

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

### Setting up the Interactor / Raycast:

* Add an **FPSController** to your scene. (Unless you’re using the demo which will already have one added, but the package will be required to be imported before use).&#x20;
* Please navigate to the scripts folder in the fuse box package and add the **FBInteractor** script to your **MainCamera**
* You can set the **Interact Distance** and **Interactive Tag** to use

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2F4CRZwFjDSakzVbFad3m2%2FFBInteracotr.JPG?alt=media&#x26;token=91462391-f671-460d-8b69-f822f177d206" alt=""><figcaption></figcaption></figure>

### Adding the FBUIManager:

* Add the "FBUIManager from the prefabs folder to your hierarchy

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2FnlUHoGBq4SYfebbd15JQ%2FFBUIManagerObjects.JPG?alt=media&#x26;token=24823212-bbd1-4f48-9114-69a3c6cd060f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2FzOJ5v6W0LcCkKOH0gM6n%2FFBUIManager.JPG?alt=media&#x26;token=c8b38a38-54d8-484a-b6a5-044f32d8a0d6" alt=""><figcaption></figcaption></figure>

* Add the crosshair image from the **CrosshairCanvas** components to the **FBUIManager** crosshair slot in the inspector.
* Add the **UI - FuseAmountText** from the **Fusebox Inventory Canvas** to the **Fuse Amount Text** slot in the **FBUIManager**
* Add the **Fuse Inventory - Canvas** to the **Fuse Inventory** slot in the **FBUIManager** script so we can show and hide the canvas when needed

### Adding the FBAudioManager:

* Add the **FBAudioManager** script or from the **prefabs** folder&#x20;
* Make sure all the ScriptableObject sound effects you wish to use, are in the array. See more details on adding new sound effects here

{% content-ref url="../support/adding-audioclips" %}
[adding-audioclips](../support/adding-audioclips)
{% endcontent-ref %}

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2FDV2Sg1jBpTThsfapuIjO%2FFBAudioManager.JPG?alt=media&#x26;token=29f7919f-71f2-4f3a-9378-958510f2e02f" alt=""><figcaption></figcaption></figure>

### Adding the FBInputManager:

* Add the **FBInputManager** script or from the **prefabs** and choose the inputs for the system

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2FvHJuh8NCD7WLdbxdGH5y%2FFBInputerManager.JPG?alt=media&#x26;token=2d4befd1-cbef-4131-8c34-9b1608c35510" alt=""><figcaption></figcaption></figure>

### Adding the FBInventoryManager:

* Make sure the **FBInventoryManager** script or from the prefabs

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2Fn2xuK5r00TU1rGk2yIAB%2FFBInvenotry.JPG?alt=media&#x26;token=92c7cabf-5289-4834-af51-0c1c62a3c7a1" alt=""><figcaption></figcaption></figure>

### Adding Collectable Fuses:

* Place a **Single\_Fuse** into your scene from the prefabs folder.
  * Make sure it has the tag of **InteractiveObject**
  * Add a **Box Collider**
  * Add a **FuseItem** and set this to **Fuse**
  * Add the audio scriptable for the **Pickup Sound**

{% hint style="info" %}
**NOTE:** You can duplicate these later if you need as many fuses as you require to complete the puzzle.
{% endhint %}

![](https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2FaHQcyDgy2hdCUAqkgxXV%2FFuseCollectableObject.JPG?alt=media\&token=f03ce278-fdbc-42f9-8df1-183fa7f5cd96)

### Adding a Fusebox / Controller:

* Add the **FuseBox\_Parent\_Controller** to your scene and place it where you want.&#x20;
  * Make sure this has a tag of **InteractiveObject**
  * It will need a **FuseItem** script set to **Fusebox**
  * Make sure it has a **Box Collider**&#x20;
  * There is no need to add the sound audio SO here
* It will also need a **FBController** script as well.

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2F0rzX4eXLAMuehEF2rose%2FFBControllerMain.JPG?alt=media&#x26;token=21945694-4f22-4e1b-8dfd-2cb2465995ac" alt=""><figcaption></figcaption></figure>

### FBController Settings:

* Look at the **FBController** in the inspector on the **FuseBox\_Parent** you just added.

{% hint style="info" %}
NOTE: Read through the information below and attach the correct GameObjects in the **FBController** script in the inspector. See the image on the next page for more details!
{% endhint %}

|                            |                                                                                                                                                                                |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Fuse Inserted**          | Tick these boxes to specify if any fuses should be in the puzzle at the start of the game. You can leave them all at false if you need to find 4 fuses to complete the puzzle. |
| **Fuse Objects**           | Add the fuse object that exist within this parent object. As seen in the image below.                                                                                          |
| **Lights**                 | Add the **FuseBox\_Light\_x** to the slots from this parent object.                                                                                                            |
| **Green Button**           | Add the two materials that exist in the materials folder of the asset, **M\_Fuse\_Box\_Light\_Green**                                                                          |
| **Zap Sound**              | The ScriptableObject audio effect for the interaction sound                                                                                                                    |
| **Power up – UnityEvents** | You can create different events based on getting the puzzle correct, so add the “+” and add custom events you want!                                                            |

{% hint style="info" %}
You might want to increment the **FuseBox\_Parent\_Controller\_** with a **1** and **2** if you have more than one fuse box in each scene to make linking up the scripts easier.\
\
For example: **FuseBox\_Parent\_Controller\_1** and **FuseBox\_Parent\_Controller\_2**
{% endhint %}

<figure><img src="https://3364384987-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkKHhcnaYagLFHty50P8N%2Fuploads%2F8Ab25seAaCuKFnw3Xs7a%2FFuseBoxController.JPG?alt=media&#x26;token=a90e202a-1f8e-457d-9da3-31d5b445e65f" alt=""><figcaption></figcaption></figure>
