# Sprite rotation help

**URL:** <https://forum.makecode.com/t/sprite-rotation-help/42827>\
**Category:** Help\
**Tags:** game\
**Created:** [March 22, 2026, 6:51am UTC](https://forum.makecode.com/t/sprite-rotation-help/42827 "2026-03-22T06:51:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rune](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/rune/32/18951_2.png) [@Rune](https://forum.makecode.com/u/Rune)\
**Post date:** [March 24, 2026, 3:24am UTC](https://forum.makecode.com/t/sprite-rotation-help/42827/2 "2026-03-24T03:24:25Z")

</div>

Sorry I took awhile to respond, here’s how it works:

1. I used the browser extension to get the mouses location, but then I had to do a little math to make it relative to camera. I placed a sprite on that position every frame as a cursor.
2. I have another sprite for the gun, which is set to the players location every frame. I placed the gun art to the far right of the Sprite so that when it rotated it swiveled around the character.
3. Then, I used a block in the Sprite Util extension to find the angle between the player and the cursor, and set that to the guns rotation.
4. When it fired, I got the same angle and made a sprite to move in that angle using a different block in Sprite Util.

Hope this was helpful! If you want, you can look at the code in [this](https://makecode.com/_6r00xF48sHkL), it should be less laggy.

---

_[View the full topic](https://forum.makecode.com/t/sprite-rotation-help/42827)._
