# Sprite-FX Extension bug with image setting

**URL:** https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584
**Category:** Help
**Tags:** extension
**Created:** [August 25, 2026, 11:52pm UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584 "2026-08-25T23:52:29Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![X-LOONG](https://avatars.discourse-cdn.com/v4/letter/x/d6d6ee/32.png) [@X-LOONG](https://forum.makecode.com/u/X-LOONG)
#### Post date: [August 25, 2026, 11:52pm UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/1 "2026-08-25T23:52:29Z")

</div>

I made a game which includes shooting a shotgun, I used the Sprite-FX extension to rotate the shotgun around me but when I tried to change it’s image or animate it, it resets the rotation and then the image is replaced by the old one. I think it’s a problem with the actually extension as I can’t find any instances of the image changing except at the start. If there is a fix, can you please help me with it.

---

<div class="post-metadata">

### Author: ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)
#### Post date: [August 26, 2026, 3:35am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/2 "2026-08-26T03:35:13Z")

</div>

It’s not a bug, it’s just how the extension works, the setImage block is run before the sprite-fx rotation sets the rotated image so it’s just overwritten.

I forked the extension at [sargedev/sprite-fx](https://github.com/sargedev/sprite-fx) to export the `rotateImage` function which you could use to rotate the image after you set it to a frame of your animation, tho I didn’t make a block for the method so it’s only available in javascript right now.

Here’s an example of what I mean, press A to run a simple animation while the sprite rotates. Feel free to look at the code and you can replace the images in the `frames` array with any images you like to make a custom animation

> **[example animated rotation](https://arcade.makecode.com/S87547-44488-45436-91345)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)
#### Post date: [August 26, 2026, 3:44am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/3 "2026-08-26T03:44:02Z")

</div>

If you want to change the image without it reverting, you have to use the “clone current image from x to y” block, but you you clone the sprite’s image onto itself. You have to do this right before you change the image every time. As for animation… there’s no easy way unfortunately. There IS a quite convoluted way I found, so if you want me to yap about, just tell me. I do think this should be fixed, cause it makes the extension considerably less useful.

---

<div class="post-metadata">

### Author: ![X-LOONG](https://avatars.discourse-cdn.com/v4/letter/x/d6d6ee/32.png) [@X-LOONG](https://forum.makecode.com/u/X-LOONG)
#### Post date: [August 31, 2026, 1:19am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/4 "2026-08-31T01:19:43Z")

</div>

Yeah, I kinda just want to add a single frame for firing, if you can tell me, I would love to hear

---

<div class="post-metadata">

### Author: ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)
#### Post date: [August 31, 2026, 2:56am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/5 "2026-08-31T02:56:54Z")

</div>

Well, in the sprite utils extension (it’s super useful, download it if you haven’t), there’s a block that lets you run code on a specific sprite every specified period of time. You can put all your animation frames as individual images in an array, and every time that code runs, you change the image to the next image in the array, and then apply that sprite effect again. Since the code can run at a custom interval, this is basically animation. Hope that made sense!

---

<div class="post-metadata">

### Author: ![X-LOONG](https://avatars.discourse-cdn.com/v4/letter/x/d6d6ee/32.png) [@X-LOONG](https://forum.makecode.com/u/X-LOONG)
#### Post date: [September 3, 2026, 2:17am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/6 "2026-09-03T02:17:29Z")

</div>

um, kinda but i actually don’t know how to use arrays in Makecode, i kinda only used it as a list of numbers. If you can create an example for me that would be great.

---

<div class="post-metadata">

### Author: ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)
#### Post date: [September 3, 2026, 9:21pm UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/7 "2026-09-03T21:21:30Z")

</div>

Like I said, it’s kinda complicated, but it works

> **[ACTUAL Testing](https://arcade.makecode.com/82523-01358-73614-45608)**
>
> Animation testing

You can move around and press a and b to change the colors, and it’s still animated! It’s not just colors tho, you should be able to swap out the change color block with the other effects and it should still work.

---

<div class="post-metadata">

### Author: ![X-LOONG](https://avatars.discourse-cdn.com/v4/letter/x/d6d6ee/32.png) [@X-LOONG](https://forum.makecode.com/u/X-LOONG)
#### Post date: [September 6, 2026, 5:39am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/8 "2026-09-06T05:39:18Z")

</div>

Um, it’s not working, this is my game, but it ain’t changing. is it something to do with the timing or the way i set it? [https://makecode.com/\_bWFT02e7xAUo](https://makecode.com/_bWFT02e7xAUo)

---

<div class="post-metadata">

### Author: ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)
#### Post date: [September 6, 2026, 7:00pm UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/9 "2026-09-06T19:00:32Z")

</div>

Um, I haven’t looked too much yet, but there’s several problems. First of all, you don’t even have the sprite utils extension downloaded, which is needed for this to work. Second, you used the “repeat x times” block to change the frames, which means that all the frame changes happen all at once. Third, the “clone current image from x to y” block must occur right before any sprite effect is applied, otherwise it will not work. You need the sprite utils extension for the block that runs code on a specific sprite on every given interval.

---

<div class="post-metadata">

### Author: ![X-LOONG](https://avatars.discourse-cdn.com/v4/letter/x/d6d6ee/32.png) [@X-LOONG](https://forum.makecode.com/u/X-LOONG)
#### Post date: [September 7, 2026, 12:02am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/10 "2026-09-07T00:02:51Z")

</div>

Thanks, i didn’t understand how to make it only happen once so i just used a repeat with a 100ms pause and it worked! Thanks for helping

---

<div class="post-metadata">

### Author: ![ScriptScraper](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/scriptscraper/32/35438_2.png) [@ScriptScraper](https://forum.makecode.com/u/ScriptScraper)
#### Post date: [September 7, 2026, 5:36am UTC](https://forum.makecode.com/t/sprite-fx-extension-bug-with-image-setting/45584/11 "2026-09-07T05:36:30Z")

</div>

Nice! The game looks pretty cool btw, can you send the updated version with the working animations?
