Documentation

Support

Unity Lite

Open Unity Lite

Unity Lite

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

InteractableSet whether the user can interact with the button.
NormalSet the color for the button when the user isn't interacting with it.
HighlightedSet the color for when the user hovers over the button.
PressedSet the color for when the user presses the button.
Fade DurationAdjust 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:
  1. Enable Interactable.
  2. Navigate to the When button is clicked section of the button's properties.
  3. Select Add (+) to add an animation section to your button.
  4. Expand the dropdown and select the object you want to animate.
  5. Choose the action (play, pause, stop animation).
  6. Pick the specific animation you want to trigger.

Button element • Unity Lite • Unity Docs