# Detailed Setup

## Quick Tips & Troubleshooting

{% hint style="info" %}
**QUICK START:** You can add the **Gas Mask** **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 %}

### Tags Reference Guide

{% hint style="info" %}

* FPSController:&#x20;
  * Tag: **Player**
  * Layer: **Ignore Raycast** (If you have raycasting detection issues)
* MainCamera:&#x20;
  * Tag: **MainCamera**
  * Layer: **PostProcessing**
    {% endhint %}

## System Setup

### Step 1 - Setup for Post Processing

{% hint style="info" %}
My system uses a post processing profile EXCLUSIVELY for the Gas Mask effects, as it changes profiles at runtime. This can help you have your own effects for normal gameplay and then a Gas Mask profile that ONLY activates when you entire the gas OR put on a gas mask. It's up to you whether you'd like to have both profiles very similar so there isn't a massive break in gameplay visuals.&#x20;
{% endhint %}

{% hint style="info" %}
Make sure to IMPORT the post processing package from the **Window > Package Manager > Unity Registry > Search 'post'** into your project.&#x20;

* Main Camera:&#x20;
  * Add a **Post-process layer** component
    * Set the layer to **PostProcess**
    * The Trigger should be your **MainCamera**
* Create an Empty GameObject or use my **PostProcessingVolume** object:
  * Add the **Post-process Volume** script
  * Set the **IsGlobal** to true
  * Weight = 1
  * Add the **OriginalPostProcessing** profile or one you would use normally for your game

NOTE: I have a spare post processing profile called **GasMaskPostProcessing** - You can edit this to be similar to your current post processing but also needs to have Vignette and DoF as per my settings:&#x20;

* Vignette:&#x20;
  * Disabled By default
  * Intensity: 0.45
* Depth Of Field:
  * Disabled By Default
  * Focus Distance: 0.1
    {% endhint %}

{% hint style="warning" %}
Do you want to remove post processing or use that in a slightly different way? Check the page below for more instructions on how to edit and change these settings in script!
{% endhint %}

{% content-ref url="../support/postprocessing-editing" %}
[postprocessing-editing](https://speedtutoruk.gitbook.io/gas-mask-system-doc/support/postprocessing-editing)
{% endcontent-ref %}

### Step 2 - FPS Controller Setup

{% hint style="info" %}

1. You can add this from the **Prefabs** folder or you can use your own FPSController for these purposes
2. Make sure this has a tag of **Player** and a layer of **Ignore Raycast**
3. On the MainCamera: Tag **Main Camera**
4. Make sure the main camera has a **GMInteractor** script and a **Post-process Layer**
5. Set the **Post-Process layer** dropdown to **PostProcess**
   {% endhint %}

{% hint style="info" %}
If you need to use a different FPSController or edit the values from the current one check out my page below:
{% endhint %}

{% content-ref url="../support/fpscontroller-movement" %}
[fpscontroller-movement](https://speedtutoruk.gitbook.io/gas-mask-system-doc/support/fpscontroller-movement)
{% endcontent-ref %}

### &#x20;Step 3 -  Add Collectable Objects to your scene

{% hint style="info" %}

1. Add a **Gas Mask** from the prefabs folder, this should have a:
   1. **Box Collider**
   2. &#x20;**GMItem** script attached.&#x20;
      1. Set the **GMItem** type to **Gas Mask**
2. Add the number of **Gas Mask Filters** to your scene from the prefabs folder. Make sure this has a **Box Collider**
   1. Set the **GMItem** type to **Filter**
      {% endhint %}

### Step 4 -  Add a Gas Area (Particle Effect)

{% hint style="info" %}

1. Add the **Gas Damage - 1** prefab or any effect you'd like
   1. Make sure this has a **Box Collider** set this to **IsTrigger**
   2. Make sure this has a **Gas Damage** script attached
      {% endhint %}

### Step 5 - Adding each of the Managers

{% hint style="info" %}

1. Add each of the managers to your scene and you can look at each of the pages below to see all of the settings with explanations of how to use them!
   {% endhint %}

* GMHealthManager

{% content-ref url="../manager-defaults/health-manager" %}
[health-manager](https://speedtutoruk.gitbook.io/gas-mask-system-doc/manager-defaults/health-manager)
{% endcontent-ref %}

* GMController

{% content-ref url="../manager-defaults/gmcontroller" %}
[gmcontroller](https://speedtutoruk.gitbook.io/gas-mask-system-doc/manager-defaults/gmcontroller)
{% endcontent-ref %}

* GMAudioManager

{% content-ref url="../manager-defaults/audio-manager" %}
[audio-manager](https://speedtutoruk.gitbook.io/gas-mask-system-doc/manager-defaults/audio-manager)
{% endcontent-ref %}

* GMUIManager

{% content-ref url="../manager-defaults/ui-manager" %}
[ui-manager](https://speedtutoruk.gitbook.io/gas-mask-system-doc/manager-defaults/ui-manager)
{% endcontent-ref %}
