# Detailed Setup

## Quick Tips & Troubleshooting

{% hint style="info" %}
**QUICK START:** You can add the **Generator Demo Scene** to your scene and it will have all the keypad 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 %}

### Version Notes

{% hint style="info" %}

1. In v1.4 - it now uses a **CanvasGroup** and sets it from 0 to 1 to show and hide the canvas2
2. In v1.6 - There is no need for the input manager, as the inputs can be found in the Interactor and GeneratorItem scripts
   {% endhint %}

## System Setup

### Step 1 - Player Character & Raycast script

{% hint style="info" %}

1. Add an **FPSController** to your scene
   1. Make sure your **Main Camera** has a **GeneratorInteractor** script attached
   2. Make sure that your **FPSController** has a layer of **Ignore Raycast -** If you're having interaction issues
      {% endhint %}

### Step 2 - Adding Managers

{% hint style="info" %}

1. Add this set of managers from the prefabs or get the scripts from the folder (to your hierarchy or scene from the assets **Prefabs** folder)
   1. **InventoryManager**
   2. **UIManager**
   3. **AudioManager**
      {% endhint %}

### Step 3 - Inventory Manager Setup

{% hint style="info" %}

1. Look at the **InventoryManager** object and you will see the **GeneratorInventory** script attached and set references accordingly, and use values for your game.
   {% endhint %}

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

| Variable / Field   | Description                                                 |
| ------------------ | ----------------------------------------------------------- |
| Has Jerrycan       | Should you already have a jerry can at the start?           |
| Open Inventory Key | The input to open the inventory, usually the default is Tab |

### Step 4 - Audio Manager Setup

{% hint style="info" %}

1. Take a look at the **AudioManager** object and set the 4 ScriptableObjects as below, see the detailed page for more details on this below:
   {% endhint %}

{% content-ref url="/pages/xUHTgMvfAPl3Jue8yTNV" %}
[Adding Audio Clips](/generator-system-doc/support/adding-audio-clips.md)
{% endcontent-ref %}

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

### Step 5 - UI Manager Setup

{% hint style="info" %}
Check out the **UIManager** object to set the general UI elements for the package:

1. &#x20;All the general UI elements will be children of this object and can be found as named below.
2. In V1.4 it now uses a **CanvasGroup** and sets it from 0 to 1 to show and hide the canvas
   {% endhint %}

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

### Step 6 - Adding Interactive Items

{% hint style="info" %}

1. Place one or all of the **Items** from the prefabs folder into your scene, including a:&#x20;
   1. **Jerrycan - Collectable**
   2. **Generator**
   3. **FuelBarrel**
      {% endhint %}

### Step 7 - Jerrycan Setup

{% hint style="info" %}
The **Jerrycan - Collectable** should have:&#x20;

* **Box Collider**
* **GenItem** script attached (Set to **Jerrycan)**

All of this can go on the main jerrycan model object, as the others require separate colliders so we don't accidentally pick them up
{% endhint %}

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

{% hint style="warning" %}
You don't require the World Space UI elements, untick the Show UI box if you don't want it
{% endhint %}

|                 |                                                                                                                                                                                              |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ItemType        | The type of item this object is                                                                                                                                                              |
| Fuel Parameters | Set this to any value you wish your jerrycan to hold, by default it is: 100.                                                                                                                 |
| Show UI         | Choose whether you want to 3D world canvas UI to appear when hovering over the object. False for none or true, then you must add all the world space canvas elements attached to this object |
| Sound Effects   | Add the ScriptableObjects effects that are you in the corresponding folder.                                                                                                                  |

### Step 8 - Fuel Barrel Setup

{% hint style="info" %}

1. Now the **Fuel Barrel** will need to have a collider as a child of this object as the collider is used to interact.&#x20;
   {% endhint %}

![](/files/7tlZ7J9EPrntSzxEsexv)

{% hint style="info" %}

1. Then set the **FuelBarrel - Model** to have the same object and similar values as below:
   1. **Box Collider**
   2. **GeneratorItem** script (Setup to **Fuel Barrel)**
   3. Disable the **ShowUI** (if you don't want the world space UI elements)&#x20;
   4. Do the same setup as above
      {% endhint %}

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

### Step 9 - Generator Setup

{% hint style="info" %}

1. Generator Object - This will also have a Generator which will need the&#x20;
   1. **Box Collider**
   2. **GeneratorItem** script attached (Set to **Generator)**

Customisation settings are below
{% endhint %}

![](/files/EKHRcng5jnm9v8hTSCAM)

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

|                          |                                                                                                                                               |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Can Burn Fuel            | This should be ticked if you wish for the generator to use fuel when it is full                                                               |
| Fill Rate                | This is the speed that you can fill the generator                                                                                             |
| Burn Rate                | The higher this value the faster the generator will use up the fuel                                                                           |
| Can Rumble               | This makes the generator vibrate when it is activated. More settings will appear if true                                                      |
| Rumble Speed & Intensity | How fast and how intense the rumble will be                                                                                                   |
| Show UI                  | As before with the world space canvas                                                                                                         |
| Generator Events         | This is when the generator is activate or deactivated, it will run events of your choice. See below or the relevant page for more information |

### Step 10 - Setting Up An Activate Event:

{% hint style="info" %}

1. You can press the **+** in the Event to create more options when you want something to happen when you activate the generator

Below is a sample script that runs the code on the UnityEvents when the generator is either activate or deactivated. This just turns emission on materials on/off, including some lights.
{% endhint %}

{% content-ref url="/pages/knbjM5skpJpc586REb8y" %}
[Power Event](/generator-system-doc/support/power-event.md)
{% endcontent-ref %}

![](/files/jD7EFhxaByg3Fr1nlcI3)


---

# 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/generator-system-doc/getting-started/main-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.
