Detailed Setup
Last updated
Last updated
1). Add an FPSController 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). Please navigate to the scripts folder and add the LeverInteractor script to your MainCamera (If not already.
You can set the Interact Distance
The tag used to detect object in-front
2). Now drag the managers from the Prefabs folder into the hierarchy. You will need to add a UIManager / AudioManager / InputManager NOTE: Only drag this prefab into the hierarchy, not the scene.
3). UIManager: Add the crosshair image from the Crosshair- Canvas components to the LeverUIManager crosshair slot in the inspector.
4). AudioManager: Add the ScriptableObjects sound effects, found in the ScriptableObject folder to the size array of sounds. This should already be setup for you:
5). InputManager: Select the Input you wish to use for the system
6). Add a set of levers to your scene, the prefab will have a folder called Levers_1 - which will include 5 levers. You can duplicate these objects if you wish to have more or less for ONE SINGLE controller:
7). You can see the individual lever setup below:
Set the tag to InteractiveObject (The tag you specified in the Raycast script on the Main Camera)
A box collider
Add a LeverItem script to this object (If not already)
Set the ObjectType to: Lever
Set the number you want this lever to have, based on your order
Set the animation name for this item, the default is Handle_Pull
Add the Controller reference, which we will add in the later stage of this setup
8). Add a ControlBox prefab to your scene, which will have:
Component Models (These are added to the System controller, scroll down further)
Interaction Buttons (Setup below)
8b). Interactive Button Setup:
Tag: InteractiveObject
Box Collider
LeverItem script
Test Button or Reset Button depending on the button type
Animation Name: RedButton_Push
Add the controller of the system below:
9). Add a Lever System Controller to your scene, this will have a Lever System Controller script attached, see the setup below:
Lever Order
The order the levers need to be pulled to complete the sequence, match this will the numbers you set on the lever objects
Pull limit
What is the limit of the pull order, make sure it's the number of levers you have
Pull Timer
The timer you must wait before another lever can be pulled, can stop unnecessary double interactions
Interactive Objects
Add all the the levers and interactive buttons to this array. By default there will be 7 slots
Switches
Add all of the switches inside the "Control box"
Lights
Add all the lights inside the "Control box"
Buttons
Add all the buttons inside the "Control Box"
Animation Names
These are the animation names for the objects, defaults are usually ok
Sound Effects
Add the ScriptableObject audio effects for the system
Power Up Event
This is the event that will happen when the levers are pulled in the correct order and tested
10). Power Up Event