Last updated
Last updated
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!
Add an FPSController prefab to your scene. (Unless you’re using the demo which will already have one added but the package will be required to be imported before use).
You can add the ValveInteractor script to either the main camera or the main player object.
Now drag the: The Prefabs folder into the hierarchy. (NOTE: Only drag this prefab into the hierarchy, not the scene)
ValveUIManager
AudioManager
ValveInventory
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 preafb
All the UI elements will be children of the UI Manager gameobject
Select the ValveInventory – This item shouldn’t need editing at all, just make sure it’s on an empty gameobject
Select the AudioManager and add the ScriptableObjects for sounds you will have created. (The ScriptableObjects folder will have some examples)
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
Where the Valve wheel will fit:
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
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:
Just duplicate one of the sound ScriptableObjects from the Sounds folder and edit the parameters as below or check out the full page on adding Audioclips
Find more information about this on the page as this now includes saving functionality