My custom image scroll function isn't working quite as intended

So, I’m making a bit of code to scroll an image and make it loop back on itself after it reaches a certain point. My current version… mostly works, with the exception that if the offset is greater than the width of the image, it doesn’t work. I need it to loop back on itself even if the offset value is greater than the width of the image.
Screenshots of code:


(As you can see, the patterns will loop in both directions as intended. But if you change either one of the index-from-0-to-15 to repeat more or change the multiplier, you’ll find it doesn’t work.)

just set the value of index to the width or height of the image

1 Like

There is an image scrolling extension

1 Like

Do you have the link? I know there’s a background scrolling extension, but that’s not the one I want.

Oh no sorry I didn’t realise that the scrolling extension was only for backgrounds. You could animate a sprite scrolling but if you want to interact with it then I’m not too sure what you could use.

1 Like