Detailed Setup

Step 1 - Player Setup

  1. Add an FPSController prefab to your scene. (Unless you’re using the demo which will already have one)

    1. Add the ValveInteractor script to either the main camera or the main player object

    2. You can set both the interact distance and choose the interact key option

Step 2 - Adding Managers

  1. Now drag the: The Prefabs folder into the hierarchy. (NOTE: Only drag this prefab into the hierarchy, not the scene)

    1. ValveUIManager

    2. AudioManager

    3. ValveInventory

    4. Interaction Event (If you want to do a custom event after all valves are completed)

Step 3 - Valve UI Manager Setup

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

Step 4 - Valve Inventory Setup

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

Step 5 - Valve Audio Manager Setup

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

Step 6 - Creating a Valve Pickup (Wheel Object)

  1. Add a coloured valve of your choice to the scene

    1. Add a ValveItem script to the object and set the ItemType to Valve

    2. Add a ValveCollectable script and add the appropriate ScriptableObjects and your desired ScriptableObjects audio clip (Found in the ScriptableObjects folder)

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

  1. 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)

  2. Add the ValveItem script and set this to Slot

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

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

  1. Add a Box Collider to this object

  2. It should be hidden or inactive by default

  3. Add the ValveItem script and make sure it’s set to Wheel

  4. Add the ValveWheelInteractable script and look at the settings below:

Last updated

Was this helpful?