Detailed Setup
NOTE: You can get a quick start using the Valve System Scene Prefab object and drag that straight into your scene. This will everyone to be already setup, you can delete the art assets as required but checkout the demo scene if youβre confused!
Step 1 - Player Setup
Add an FPSController prefab to your scene. (Unless youβre using the demo which will already have one)
Add the ValveInteractor script to either the main camera or the main player object
You can set both the interact distance and choose the interact key option
Step 2 - Adding Managers
Now drag the: The Prefabs folder into the hierarchy. (NOTE: Only drag this prefab into the hierarchy, not the scene)
ValveUIManager
AudioManager
ValveInventory
Interaction Event (If you want to do a custom event after all valves are completed)
Step 3 - Valve UI Manager Setup
Select the ValveUIManager script and make sure all the items are connected as below
The Slot Prefab field can be found in the prefabs folder and searching for the InventorySlot prefab
All the UI elements will be children of the UI Manager gameobject
Step 4 - Valve Inventory Setup
Select the ValveInventory β This item shouldnβt need editing at all, just make sure itβs on an empty gameobject
Find more information about this on the JSON Save System page as this now includes saving functionality
Step 5 - Valve Audio Manager Setup
Select the AudioManager and add the ScriptableObjects for sounds you will have created. (The ScriptableObjects folder will have some examples)
If you need help creating audio clips to use here - Check out this page: Adding Audioclips
Step 6 - Creating a Valve Pickup (Wheel Object)
Add a coloured valve of your choice to the scene
Add a ValveItem script to the object and set the ItemType to Valve
Add a ValveCollectable script and add the appropriate ScriptableObjects and your desired ScriptableObjects audio clip (Found in the ScriptableObjects folder)
Make sure this object has a Box Collider component added
Step 7 - Creating the Valve Slot
This will be an empty GameObject or collider which acts as an invisible slot for the Valve Wheel
Add a Box Collider or cube in place of where you would like your slot to be (Where the valve will fit, this acts as an interaction point and make sure the mesh renderer is hidden)
Add the ValveItem script and set this to Slot
Add the ValveSlot script and add the appropriate ScriptableObjects, the ValveWheel object (Which should be parented to this object but hidden) and the question mark object which will also be hidden for now.
Add the appropriate audio ScriptableObjects for attaching the valve to the slot
Step 8 - Creating a Valve Wheel Object
This will be the GameObject that is hidden but spawns when you interact with an empty slot area
Add a Box Collider to this object
It should be hidden or inactive by default
Add the ValveItem script and make sure itβs set to Wheel
Add the ValveWheelInteractable script and look at the settings below:
Last updated