# Detailed Setup

{% hint style="warning" %}
**NOTE:** You can get a quick start using the **Valve System Scene 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 %}

### Step 1 - Player Setup

{% hint style="info" %}

1. Add an **FPSController** prefab to your scene. (Unless you’re using the demo which will already have one)
   1. Add the **ValveInteractor** script to either the main camera or the main player object
   2. You can set both the interact distance and choose the interact key option
      {% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FPNB4zmmIVviWcq56PD9o%2FValveInteractor.JPG?alt=media&#x26;token=2b1d074d-ca09-4dc3-b63b-96ad242f8f5f" alt=""><figcaption></figcaption></figure>

### Step 2 - Adding Managers

{% hint style="info" %}

1. Now drag the: The **Prefabs** folder into the hierarchy. **(NOTE: Only drag this prefab into the hierarchy, not the scene)**
   1. ValveUIManager
   2. AudioManager
   3. ValveInventory
   4. Interaction Event (If you want to do a custom event after all valves are completed)
      {% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FNGfeRmXe4lEZoQCoBkRt%2FManagersList.JPG?alt=media&#x26;token=6ac53a1b-1bd7-462d-a77e-06e65d27887c" alt=""><figcaption></figcaption></figure>

### Step 3 - Valve UI Manager Setup

{% hint style="info" %}

1. Select the **ValveUIManager** script and make sure all the items are connected as below
   {% endhint %}

{% hint style="warning" %}
The Slot Prefab field can be found in the prefabs folder and searching for the **InventorySlot** prefab
{% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FiQ8HqCly55YmibPhT3dN%2FUIManagerValve.JPG?alt=media&#x26;token=3762cb1b-6da6-4a0b-8d93-b03eb8e63e65" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
All the UI elements will be children of the UI Manager gameobject
{% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2Fzs9OxPnctX2QPBYhDe96%2FUIManagerItems.JPG?alt=media&#x26;token=8ff97fc1-9003-4b4b-a957-8130a44cd2a0" alt=""><figcaption></figcaption></figure>

### Step 4 - Valve Inventory Setup

{% hint style="info" %}

1. Select the **ValveInventory** – This item shouldn’t need editing at all, just make sure it’s on an empty gameobject
   {% endhint %}

{% hint style="warning" %}
Find more information about this on the [JSON Save System](https://speedtutoruk.gitbook.io/valve-pipe-system-doc/getting-started/json-save-system) page as this now includes saving functionality&#x20;
{% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2F8JjPVELtKGfYX23vggDr%2FValveInventory.JPG?alt=media&#x26;token=2b0fafc0-5a5b-4c7d-838b-bc61998a041b" alt=""><figcaption></figcaption></figure>

### Step 5 - Valve Audio Manager Setup

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

{% hint style="warning" %}
If you need help creating audio clips to use here - Check out this page: [adding-audioclips](https://speedtutoruk.gitbook.io/valve-pipe-system-doc/support/adding-audioclips "mention")
{% endhint %}

![](https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FZDMgkBordv3wmqGsewf3%2FValveAudioManager.JPG?alt=media\&token=aaf3f1bf-7f98-4659-a4d8-b1c3cf692bc8)

### Step 6 - Creating a Valve Pickup (Wheel Object)

{% hint style="info" %}

1. Add a coloured valve of your choice to the scene
   1. Add a **ValveItem** script to the object and set the **ItemType** to **Valve**
   2. Add a **ValveCollectable** script and add the appropriate ScriptableObjects and your desired ScriptableObjects audio clip (Found in the ScriptableObjects folder)
   3. Make sure this object has a B**ox Collider** component added
      {% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FK5BsnyP0LHnF1jojLp7E%2FValvePickup.JPG?alt=media&#x26;token=672b9439-1435-48bf-83c4-18cf7b3f3e23" alt=""><figcaption></figcaption></figure>

### Step 7 - Creating the Valve Slot

{% hint style="info" %}
This will be an empty GameObject or collider which acts as an invisible slot for the Valve Wheel

1. Add a **Box Collider or cube** in place of where you would like your slot to be (Where the valve will fit, this acts as an interaction point and make sure the mesh renderer is hidden)
2. Add the **ValveItem** script and set this to **Slot**
3. Add the **ValveSlot** script and add the appropriate ScriptableObjects, the ValveWheel object (Which should be parented to this object but hidden) and the question mark object which will also be hidden for now.
4. Add the appropriate audio ScriptableObjects for attaching the valve to the slot
   {% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2FACfshb6jV6HBk2kL0jmv%2FValveSlot.JPG?alt=media&#x26;token=8415b03b-c7c0-47f9-9b2d-624604a49855" alt=""><figcaption></figcaption></figure>

### Step 8 - Creating a Valve Wheel Object

{% hint style="info" %}
This will be the GameObject that is hidden but spawns when you interact with an empty slot area

1. Add a **Box Collider** to this object
2. It should be hidden or inactive by default
3. Add the **ValveItem** script and make sure it’s set to **Wheel**
4. Add the **ValveWheelInteractable** script and look at the settings below:
   {% endhint %}

<figure><img src="https://2603187028-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MjdKSOjgTfiywrbk7Lg%2Fuploads%2F9JABDcQN3SWDECy67Tq0%2FValveWheel.JPG?alt=media&#x26;token=bfd480c4-2f7e-41ea-9949-c51775a4bf34" alt=""><figcaption></figcaption></figure>
