# Animation when Left/Right of enemy

**URL:** <https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106>\
**Category:** Help\
**Created:** [December 17, 2020, 7:08pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106 "2020-12-17T19:08:07Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [December 17, 2020, 7:08pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/1 "2020-12-17T19:08:07Z")

</div>

Hi! I wanted to make a naruto style fighting game and I need help!  
If I am left of the enemy I want to look right  
And If I am right of him I want to look left(so I have my eyes on target)  
I have both animations for left and right but I could not figure it out. I tried using the angle from the sprite utils extension! Help pls!  
Thx

> **[Naruto The Fight](https://arcade.makecode.com/28052-63569-15429-63287)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [December 17, 2020, 10:00pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/2 "2020-12-17T22:00:46Z")

</div>

> [@DahbixLP](#):
>
> I have both animations for left and right but I could not figure it out. I tried using the angle from the sprite utils extension! Help pls!

My first post was just to point out that you can have an animation for not moving and facing a particular direction. This post demonstrates that the player faces the enemy after it finishes moving:

> **[Naruto The Fight (now facing enemy)](https://arcade.makecode.com/77378-67795-15021-73968)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)\
**Post date:** [December 17, 2020, 10:00pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/3 "2020-12-17T22:00:56Z")

</div>

You had the character animations in the game update method. The game update runs continuously, but you only need to register the character animations once. I also changed ‘Animation Naruto Still’ to ‘Animation Naruto Still R’ and used this when ‘not moving’ and ‘facing right’; and vice versa.

> **[Naruto The Fight](https://arcade.makecode.com/41137-74604-00513-04414)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<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:** [December 17, 2020, 10:01pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/4 "2020-12-17T22:01:03Z")

</div>

Already fixed! I used 2 sprites left and right of the enemy to detect!

---

<div class="post-metadata">

**Author:** ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)\
**Post date:** [December 17, 2020, 10:32pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/5 "2020-12-17T22:32:41Z")

</div>

There’s an extension that helps with this.

> **[riknoll/character-animations](https://github.com/riknoll/character-animations)**
>
> Contribute to riknoll/character-animations development by creating an account on GitHub.

This extension helps with animations. It let’s you set specific animations based on which direction you want your sprite to go.

---

<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:** [December 17, 2020, 10:56pm UTC](https://forum.makecode.com/t/animation-when-left-right-of-enemy/5106/6 "2020-12-17T22:56:40Z")

</div>

I am using this! I meant with that If you where ever I am I look at the enemy!  
The animation is already good! Thanks tho!
