Gas Mask Sys - Setup
Last updated
Last updated
Make sure to have a "GasMask_Canvas" object in your scene which will have all the UI elements. This will be a child of the "AK_CanvasContainer" if you've already imported it from the initial setup
Make sure the "MainCamera" has the "Vignette and Chromatic Abberation" and "Blur Optimized" scripts. These should a ready be attached to your FPSController - MainCamera (If you imported from the prefabs folder.
In the "FPSController" script, will need to make sure the WalkSpeed and RunSpeed are both public to access them within the Gas Mask Controller, this will be automatically done if you're using the FPSController prefab from the prefabs
Make sure you have the Gas Mask Canvas added
Make sure the MainCamera has both "Vignette and Chromatic Abberation" & "Blur" scripts
Note that these two older image effects can be changed for your own creations
Add a "Gas Mask Controller" prefab or script to a gameobject - See setup below
Add a "Gas Mask Health Manager" prefab or script to a gameobject - See setup below
Add the Gas Mask PBR model to your scene, have these settings
Set the tag to "InteractiveObjects"
Set the layer to "Interact"
Add a "Box Collider"
Add an "AKItemController" and set the value to "GasMaskSys"
Add the "GasMaskItemController" script and set it to "GasMask" or "Filter" depending on the item you wish to use.
Add a PBR Filter model to your scene Follow the same setups above for this asset
See more details below:
This "GasMaskController" script can be added from the prefab or added to an empty gameobject
This "GasMaskController" script can be added from the prefab or added to an empty gameobject
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
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”
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"
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
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
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
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
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
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