Make a widget play an attack animation on click?

im making a mobile rpg game , is there any proper tutorials on how to make the widgets play attack animations when clicked ? and it would be awsome if someone proposed a tutorial on how make the character play different attacks with the same button as in mobile rpg games
ex : like when i click on the same widget with long time between the two or three clicks it plays first simple attack , but if the time between the clicks was close the attacks it plays different attack animations , thank you

Don’t know a tutorial but YT is your friend.

Here’s a quick and dirty example:

Holding the button down for 1, 2, 3 or more seconds will charge it up. Releasing the button fires the respective attack. Releasing too early, before 1s has gone past, does nothing.

If you need more precision, use elapsed time instead, checking whether the float is In Range.


like when i click on the same widget
with long time between the two or
three clicks

You can count clicks with a variable retrievable delay and fire if conditions are met.

thanks for your help

how can i make a button on hud when clicked the character will do attack.