# Moving Sprite/projectile in the direction of another sprite without using follow

**URL:** <https://forum.makecode.com/t/moving-sprite-projectile-in-the-direction-of-another-sprite-without-using-follow/18431>\
**Category:** Arcade\
**Tags:** game, graphics-and-math\
**Created:** [March 13, 2023, 5:38pm UTC](https://forum.makecode.com/t/moving-sprite-projectile-in-the-direction-of-another-sprite-without-using-follow/18431 "2023-03-13T17:38:27Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [March 13, 2023, 5:38pm UTC](https://forum.makecode.com/t/moving-sprite-projectile-in-the-direction-of-another-sprite-without-using-follow/18431/1 "2023-03-13T17:38:27Z")

</div>

Hi all!

If we wanted a sprite to shoot towards another/ spawn a projectile to spawn in the direction of another sprite do you guys have any idea how I could do that? I know it’s tricky as I’d need to calculate a velocity that goes at a set speed and in the required direction so I was just wondering if anyone was aware of a nice algorithm for that?

Thanks in advance for any suggestions

---

<div class="post-metadata">

**Author:** ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)\
**Post date:** [March 13, 2023, 5:50pm UTC](https://forum.makecode.com/t/moving-sprite-projectile-in-the-direction-of-another-sprite-without-using-follow/18431/2 "2023-03-13T17:50:38Z")

</div>

There is an extension called the [Sprite Utilities](https://github.com/jwunderl/arcade-sprite-util) extension that would work for this (If I’m understanding correctly).  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b955065e4222a944e13b1b11ac2fc5cad078d948.png)

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/35fae0e15ba42f55be11d7221632a0d9e8888e0b.png)  
This is how you would use the blocks.  
I hope this helps! 🙂

---

<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:** [March 13, 2023, 11:45pm UTC](https://forum.makecode.com/t/moving-sprite-projectile-in-the-direction-of-another-sprite-without-using-follow/18431/3 "2023-03-13T23:45:16Z")

</div>

Fantastic, that’s perfect. Thanks so much for your help.
