Gas Mask Sys - Setup

Gas Mask System - Video Setup

Gas Mask Controller Main Setup

public float m_WalkSpeed;
public float m_RunSpeed;

Gas Mask System - Basic Steps

  1. Make sure you have the Gas Mask Canvas added

  2. Make sure the MainCamera has both "Vignette and Chromatic Abberation" & "Blur" scripts

    1. Note that these two older image effects can be changed for your own creations

  3. Add a "Gas Mask Controller" prefab or script to a gameobject - See setup below

  4. Add a "Gas Mask Health Manager" prefab or script to a gameobject - See setup below

  5. Add the Gas Mask PBR model to your scene, have these settings

    1. Set the tag to "InteractiveObjects"

    2. Set the layer to "Interact"

    3. Add a "Box Collider"

    4. Add an "AKItemController" and set the value to "GasMaskSys"

    5. Add the "GasMaskItemController" script and set it to "GasMask" or "Filter" depending on the item you wish to use.

  6. Add a PBR Filter model to your scene Follow the same setups above for this asset

See more details below:

Gas Mask Controller Setup

This "GasMaskController" script can be added from the prefab or added to an empty gameobject

Gas Mask Features:

Max Equip Mask Timer

The time in seconds, it takes to equip the gas mask using the held button press

Default: 1

Mask Equipped Color

The equipped colour of the mask UI

Default: Green

Mask Normal Color

The normal colour of how the mask in the UI

Default: White

Movement Speeds

Walk Norm

The normal walk speed of the FPSController

Default: 5

Walk Gas

The speed of the FPSController inside Gas

Default: 2

Run Norm

The normal running speed of the FPSController

Default: 10

Run Gas

The speed of the FPSController running inside gas

Default: 4

Filter Options:

Max Filter Timer

The maximum timer value

Default: 100

Filter Fall Rate

The speed at which the filter percentage falls, increase for more speed

Default: 2

Warning Percentage

At what percentage should we show the UI warning?

Default: 20

Default Vignette

The default value of the vignette

Default: 0.28

Mask Filters

How many filers does the player currently have?

Default: 0

UI References:

Mask Icon UI

Add the ā€œMask Icon UIā€ from the CanvasManager

Filter Icon UI

Add the ā€œFilter Icon UIā€ from the CanvasManager

Filter Collected UI

Add ā€œFilters Collected UIā€ from the CanvasManager

Filter Percentage UI

Add ā€œFilter Percentage UIā€ from CanvasManager

Effect References:

Vignette Effects

Add the "Main Camera" to this slot

Blur Effect

Add the "Main Camera" to this slot

Visor Image UI

Add the "VIsor_Mask_Overlay" image from the Gas Mask canvas

Can Breath?

A check to see if the player is inside the gas or not

Gas Mask Health Controller

This "GasMaskController" script can be added from the prefab or added to an empty gameobject

Player Health

The normal player health

Default: 100

Health Fall

This is the health fall rate

Default: 2

Max Health

The Maximum health the player can have

Default: 100

Health UI Reference

Add the "HealthUI" from the "GasMaskCanvas"

N/A

Death Event()

You can add a script and reference a public method to do something when your health becomes zero

N/A

Gas Mask Items and Pickups

Gas Mask Object setup - You can add a PBR Gas Mask Object to your scene

  • Make sure your Gas Mask object has a tag of "InteractiveObject" and a Layer of "Interact"

  • Add a "Box Collider" to your object

  • Add an "AKItemController" - Set the System Type to: "GasMaskSys"

  • Add a "GasMaskItemController" script to the object

    • Choose the object type: Gas Mask

    • Or: "Filter" - If this is a filter object

Setting up - Gas Prefab

You can now add one of the ā€œMist_Green_Particle_Prefabā€ to your scene, or you can create your own inaccessible area by creating a collider, and adding the ā€œGasDamageā€ script to it. Remember to set this collider to ā€œisTriggerā€

Default Controls

  • Left Click to interact with a pickup

  • Hold ā€œGā€ to equip/unequip the gas mask

  • Press ā€œTā€ to replace the filter

  • Press ā€œTABā€ to open the inventory

  • NOTE: The filter will automatically change filters at the percentage you specify, if you have a spare filter in the inventory!

These can be edited in the "InputManager"

Last updated

Was this helpful?