Comment on page

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!

Player Setup:

  • 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.

Adding Managers:

  • Now drag the: The Prefabs folder into the hierarchy. (NOTE: Only drag this prefab into the hierarchy, not the scene)
    • InputManager
    • ValveUIManager
    • AudioManager
    • ValveInventory

Valve UI Manager Setup:

  • Select the ValveUIManager script and make sure all the items are connected as below:
  • All the UI elements will be children of the UI Manager gameobject

Valve Inventory Setup:

  • Select the ValveInventory – This item shouldn’t need editing at all, just make sure it’s on an empty gameobject

Valve Input Manager Setup:

  • Select the InputManager and make sure you choose button commands that you wish, from the dropdowns

Valve Audio Manager Setup:

  • Select the AudioManager and add the ScriptableObjects for sounds you will have created. (The ScriptableObjects folder will have some examples)

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

Creating the Valve Slot

  • 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

Creating a Valve Wheel Object

  • 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:

How to create ScriptableObjects for sounds:

  • 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