Levers
Levers are interactables which can switch between an on and off state. You can create 2 types of levers: rotational levers and positional levers. Both function in the exact same way, except that their state is visualized by a difference in rotation and position respectively.
Setup
To create a lever, you will need 3 components:
- Interactable - Used to detect when the player is looking at the lever.
- RotationToggle or PositionToggle - Set the lever's state and updates it visual.
- Collider - Any type of collider defining the interaction bounds.
Do note, the RotationToggle and PositionToggle components function in almost exactly the same way, so we'll only be looking at the RotationToggle here.

Animation
By default, the lever will be animated via scripting.
- Assign a
Rotate Object, which is what wll be doing the movement. - You can then define a local
On RotationandOff Rotationfor the object to rotate between. - The
Rotate Timeis how long it takes for the lever to animate. - The
Rotate Curveallows you to have smooth movement, a gradual increase in speed, or whatever you wish.

Instead of rotating the lever via script (which is the default setting), you can choose to connect it to an Animator component. To do this, simply enable Use Animator.
The Is On Bool Parameter Name is the boolean parameter the component will toggle on the referenced Animator component. Hook this up however you like to your animation.

Events
Now you probably want your lever to do something instead of just flicking back and forth. In the Events dropdown, you can connect the OnTurnOn and OnTurnOff events to whatever you want. If it's to a door, as in the example below, drag in the Door component and connect to it's Open and Close functions.
