Button element
Add a Button the user can interact with to trigger an action.
Read time 1 minuteLast updated 2 days ago
A Button is an interactive element that users can click to perform an action, such as start an animation or interact with an object in the scene. A Button contains a parent Button object and a child Text object (where you set the button's label).
Button properties
The following properties are available for you to customize in the button's Inspector panel:Property | Description |
---|---|
Interactable | Set whether the user can interact with the button. |
Normal | Set the color for the button when the user isn't interacting with it. |
Highlighted | Set the color for when the user hovers over the button. |
Pressed | Set the color for when the user presses the button. |
Fade Duration | Adjust the fade duration for color changes. |
Trigger animations | Make the button trigger an animation in your scene when the user selects it. For instructions, refer to Trigger button animations. |
Trigger button animations
You can set a button to trigger an animation in your scene:- Enable Interactable.
- Navigate to the When button is clicked section of the button's properties.
- Select Add (+) to add an animation section to your button.
- Expand the dropdown and select the object you want to animate.
- Choose the action (play, pause, stop animation).
- Pick the specific animation you want to trigger.