We have animation states for Normal, Highlighted, Pressed and Disabled. How to set animation when a button is clicked?(after button released not pressed)?

Thanks in advance


1 Answer 1


In order to use animations as UI buttons transition, an Animator component should exist. you can generate it.

ui button

in the generated animation controller, just drag and drop your animations into the state inspector.

Doc: https://docs.unity3d.com/Manual/script-SelectableTransition.html

Now, in case you want to fire your events AFTER the button click (onPointerUp), you'll have to use Event Trigger component instead.

  • \$\begingroup\$ What I want (click button and after clicked not after pressed run animation) 1.Click the button. 2.Play the button animation. 3.The button animation gets finished. 4.After that we call some method in some script. \$\endgroup\$
    – Sh.Adel
    Commented Nov 12, 2018 at 10:59
  • 1
    \$\begingroup\$ Then you will have to use the Event Trigger component with an OnPointerUp event that calls some method on your script. play animation -> waitforseconds -> call logic. \$\endgroup\$ Commented Nov 12, 2018 at 11:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .