# Code not running and animation not working, please help

**URL:** <https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990>\
**Category:** Help\
**Tags:** game\
**Created:** [April 7, 2023, 10:13pm UTC](https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990 "2023-04-07T22:13:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [April 7, 2023, 10:13pm UTC](https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990/1 "2023-04-07T22:13:01Z")

</div>

Here is the game, i have commented on the code not running and where the animations is not working

> **['The Dungeons of Ravna' game](https://arcade.makecode.com/S47613-35177-23464-22908)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![neintoes](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neintoes/32/8315_2.png) [@neintoes](https://forum.makecode.com/u/neintoes)\
**Post date:** [April 7, 2023, 11:34pm UTC](https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990/2 "2023-04-07T23:34:08Z")

</div>

I haven’t used the Character Animation extension before so I’m not 100% sure if this is why my solution works but I think the problem is that you call your ‘characterAnim’ function in your ‘on start’ before the ‘Character’ sprite exists.

By calling the ‘characterAnim’ function directly after the sprite has been created it seems to play your walking animations now.

 ![image_2023-04-08_000847421](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/4a3b89cf5c29e61553f95854567fd51ea71bbc80.png)

---

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [April 10, 2023, 5:25pm UTC](https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990/3 "2023-04-10T17:25:13Z")

</div>

I just got all the code to work, with help from @neintoes!

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [April 10, 2023, 5:25pm UTC](https://forum.makecode.com/t/code-not-running-and-animation-not-working-please-help/18990/4 "2023-04-10T17:25:18Z")

</div>

I always run character animations forever on a game update loop
