# Make a widget play an attack animation on click?

**URL:** <https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966>\
**Category:** Character & Animation\
**Tags:** unreal-engine, melee, Widget, question, Blueprint\
**Created:** [September 17, 2018, 6:05pm UTC](https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966 "2018-09-17T18:05:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![electronicvision](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@electronicvision](https://forums.unrealengine.com/u/electronicvision)\
**Post date:** [September 17, 2018, 6:05pm UTC](https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966/1 "2018-09-17T18:05:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 17, 2018, 9:45pm UTC](https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966/2 "2018-09-17T21:45:12Z")

</div>

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

Here’s a quick and dirty example:

 ![253952-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/8/3b81ce90ac751527abb11ed90915d0ca6756eea3.png)

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.

---

<div class="post-metadata">

**Author:** ![electronicvision](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@electronicvision](https://forums.unrealengine.com/u/electronicvision)\
**Post date:** [September 18, 2018, 5:15pm UTC](https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966/3 "2018-09-18T17:15:37Z")

</div>

thanks for your help

---

<div class="post-metadata">

**Author:** ![LucentStar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucentStar](https://forums.unrealengine.com/u/LucentStar)\
**Post date:** [November 27, 2018, 2:57pm UTC](https://forums.unrealengine.com/t/make-a-widget-play-an-attack-animation-on-click/433966/4 "2018-11-27T14:57:31Z")

</div>

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