# Animation won't play for dash attack

**URL:** <https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018>\
**Category:** Help\
**Created:** [April 8, 2022, 11:24pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018 "2022-04-08T23:24:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)\
**Post date:** [April 8, 2022, 11:24pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/1 "2022-04-08T23:24:13Z")

</div>

Whenever you use the dash attack in the game, instead of playing the animation for the dash attack, sometimes the animation doesn’t play. (dash by double tapping left or right)

> **[Super Smash Rivals](https://arcade.makecode.com/46178-17725-30206-25711)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)\
**Post date:** [April 13, 2022, 6:39pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/2 "2022-04-13T18:39:15Z")

</div>

please help if you can

---

<div class="post-metadata">

**Author:** ![DahbixLP](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dahbixlp/32/4760_2.png) [@DahbixLP](https://forum.makecode.com/u/DahbixLP)\
**Post date:** [April 14, 2022, 7:04pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/3 "2022-04-14T19:04:41Z")

</div>

Some tips for you bc I had a stroke looking at the code because its unnecessarily complicated  
For example instead of this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/bbf2e833a7701f8dca22f0c06cbe19993f83771c.png)  
Do this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/449b004b89067f63e9e643875a99f711e61f9125.png)  
And instead of this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8bc076be308d247bc05c50dd0eab683d6a3de68e.png)  
Do this:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/e/e08757442276685caae3ea53fc24cd7a1c6f69ab.png)  
This only works with true/false  
What I did is that instead of putting the animation in a variable I put it into the do animation directly!

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 18, 2022, 5:19pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/4 "2022-04-18T17:19:10Z")

</div>

Hi Jaky!  
Try this please, is it resolve your issue?

> **[Super Smash Rivals](https://arcade.makecode.com/71197-24445-82991-61355)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Just adding one line (line 351)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/ce80670e58b58bbd67b31091cfb2b9f4e62b40ca.png)

If it does, the reason of this issue probably is:  
I saw you called the same in function animation2() when higlag==true, but according to line 347, the hitlag back to false after about 375ms, so the characterAnimations of P1 enabled again.

BTW, it would be a hard work to set so many kind of action animations in one character, very impressive! Keep on your great work, good luck!

---

<div class="post-metadata">

**Author:** ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)\
**Post date:** [April 20, 2022, 5:02pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/5 "2022-04-20T17:02:08Z")

</div>

Yes. it works! Thank you for helping me solve this problem.

---

<div class="post-metadata">

**Author:** ![TheJaky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/thejaky/32/5711_2.png) [@TheJaky](https://forum.makecode.com/u/TheJaky)\
**Post date:** [April 20, 2022, 5:02pm UTC](https://forum.makecode.com/t/animation-wont-play-for-dash-attack/13018/6 "2022-04-20T17:02:11Z")

</div>

Ok, thank you for the simplifying tips!
