- Home /
UI button pressed animation
HI all,
is possible, without code, to have an animation assigned to a button on press, that plays till the end BEFORE the action of the pressed button? For example my button when pressed play an animation and THEN navigate to an other menu? At the moment it plays a few frames and immediately jump to the next menu. I am looking for a way to do that without any use of code, hoping there is a setting somewhere or a box to tick that I missed.
Thank you in advance,
regards
Thomas
Answer by Propagant · Jun 12, 2017 at 11:16 AM
You can play Crossfade animation through UI button without scripting. Or just assign animation clip and then Sample(). Just play with it.
HI,
thank you, but I am afraid I do not understand your answer. I have animations assigned to normal, highlighted and pressed state. $$anonymous$$y issue is with the pressed state : it does not play fully before doing the function it is supposed to do (like displaying an other menu).
cheers
Answer by hexagonius · Jun 12, 2017 at 02:13 PM
Your problem is that the animations are not directly linked to the button behavior. A click is just pointerdown -> pointerup, no matter what speed. I recommend not delaying the button on cases of button cascades, it annoys people to wait. Use it sparsely.
In your case I would avoid using the click event of the button altogether and instead use an animation trigger within your pressed animation clip's end frame to do the button functionality. Be careful to not allow transition interruption though.
Your answer
Follow this Question
Related Questions
Play an animation when UI button is pressed 0 Answers
Material Design Menu 1 Answer
Unity 4.6 UI Button Click Animation? 4 Answers
Animation bug when click and hold on Button edge 1 Answer
Button stuck on pressed 2 Answers