Buttons
Buttons are interactables which can trigger an event and animate via scripting or an Animator component.
Setup
To create a button, you will need 3 components.
- Interactable - Used to detect when the player is looking at the button.
- PressableButton - Trigger the event and animate the button.
- Collider - Any type of collider defining the interaction bounds.

Animation
By default, the button will be animated via scripting.
- Assign a
Button Object, which is what will be doing the moving. - You can then define a local
Default PositionandPressed Positionfor the object to move between. - The
Press Durationis how long the total press animation will take. - The
Press Curveallows you to have smooth movement, or a sudden click then gradual return.

Alternatively, you can choose to animate the button via an Animator component. This can be good if you have multiple objects you wish to animate.
- Enable
Use Animator. - Reference your Animator components.
- The
Press Trigger Parameter Nameis the name of the trigger that will be triggered in the Animator when the button is pressed. Implement this in your Animator as you see fit.

Events
The button has a single event: OnPress, which invoked when the button is pressed!