Detailed Setup
Quick Tips & Troubleshooting
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
TextMeshPro Required
Please note that TMP will appear as a popup if not installed in your project
Click Import TMP Essentials to use the system fully
Version Notes
In v1.4 - it now uses a CanvasGroup and sets it from 0 to 1 to show and hide the canvas2
In v1.6 - There is no need for the input manager, as the inputs can be found in the Interactor and GeneratorItem scripts
System Setup
Step 1 - Player Character & Raycast script
Add an FPSController to your scene
Make sure your Main Camera has a GeneratorInteractor script attached
Make sure that your FPSController has a layer of Ignore Raycast - If you're having interaction issues
Step 2 - Adding Managers
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)
InventoryManager
UIManager
AudioManager
Step 3 - Inventory Manager Setup
Look at the InventoryManager object and you will see the GeneratorInventory script attached and set references accordingly, and use values for your game.
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
Take a look at the AudioManager object and set the 4 ScriptableObjects as below, see the detailed page for more details on this below:
Step 5 - UI Manager Setup
Check out the UIManager object to set the general UI elements for the package:
All the general UI elements will be children of this object and can be found as named below.
In V1.4 it now uses a CanvasGroup and sets it from 0 to 1 to show and hide the canvas
Step 6 - Adding Interactive Items
Place one or all of the Items from the prefabs folder into your scene, including a:
Jerrycan - Collectable
Generator
FuelBarrel
Step 7 - Jerrycan Setup
The Jerrycan - Collectable should have:
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
You don't require the World Space UI elements, untick the Show UI box if you don't want it
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
Now the Fuel Barrel will need to have a collider as a child of this object as the collider is used to interact.
Then set the FuelBarrel - Model to have the same object and similar values as below:
Box Collider
GeneratorItem script (Setup to Fuel Barrel)
Disable the ShowUI (if you don't want the world space UI elements)
Do the same setup as above
Step 9 - Generator Setup
Generator Object - This will also have a Generator which will need the
Box Collider
GeneratorItem script attached (Set to Generator)
Customisation settings are below
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:
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.
Last updated