# Help with animations

**URL:** <https://forum.makecode.com/t/help-with-animations/37519>\
**Category:** Help\
**Created:** [June 24, 2025, 5:45pm UTC](https://forum.makecode.com/t/help-with-animations/37519 "2025-06-24T17:45:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justasmallcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/justasmallcoder/32/24428_2.png) [@Justasmallcoder](https://forum.makecode.com/u/Justasmallcoder)\
**Post date:** [June 24, 2025, 5:45pm UTC](https://forum.makecode.com/t/help-with-animations/37519/1 "2025-06-24T17:45:30Z")

</div>

I’m having trouble having my character attack when you press the A button. It either doesn’t animate or always attacks to the right.

Can someone please help me with this?

> **[Survival game thingy](https://arcade.makecode.com/62281-38762-16931-69312)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![dogSquid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dogsquid/32/26689_2.png) [@dogSquid](https://forum.makecode.com/u/dogSquid)\
**Post date:** [June 25, 2025, 5:16pm UTC](https://forum.makecode.com/t/help-with-animations/37519/2 "2025-06-25T17:16:19Z")

</div>

I hope no one has already replied and it just hasn’t been approved yet because that just gets awkward. 😐

Anyway, the problem is that the game knows when you are _moving_ left or right or up or down, but not where you are _facing_. So I literally just did this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/e/feadd8ad56293aa07dc4b00f311d4c1bc109bc6a.png)

I’m sure you can see this difference. Now the game knows where you are facing, you will attack in the right direction!

🙂 :boom:

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [June 25, 2025, 5:18pm UTC](https://forum.makecode.com/t/help-with-animations/37519/3 "2025-06-25T17:18:51Z")

</div>

Great artwork on the water!  
The issue was that you were setting the character animation only when the player was moving, not when they were facing any direction. This means the ‘facing’ property was never assigned a value. In order for your ‘if facing’ statement to work when determining which direction to attack, I added character animations for when the player stops moving and faces a direction.

> **[Survival game thingy (Randomuser fix)](https://arcade.makecode.com/S33621-53117-49426-50399)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![Justasmallcoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/justasmallcoder/32/24428_2.png) [@Justasmallcoder](https://forum.makecode.com/u/Justasmallcoder)\
**Post date:** [June 27, 2025, 6:35pm UTC](https://forum.makecode.com/t/help-with-animations/37519/4 "2025-06-27T18:35:40Z")

</div>

Thanks both of you : D
