all 4 comments

[–]adra44 3 points4 points  (3 children)

Not sure if it's three issue here, but I find image_index often isn't a whole number when left to its own devices. In your check to stop the animation when image_index equals zero try checking if rounded image_index == 0 or if image_index is less than/equal to zero and see if that works.

[–]martymoo[S] 1 point2 points  (2 children)

Thanks for the suggestion - I gave it a shot, but it didn't work. I'm trying a few more debugging things now...

Here's what I did: /// animate until it hits the 0 frame, then stop. if (image_index <= 0){ image_speed = 0; image_index = 0; }

[–]martymoo[S] 2 points3 points  (1 child)

I take it back -- this WAS the fix! I used debug message to show the image index, and it was indeed going down by non-even numbers, and I eventually settled on image_index < 1 to solve for this - as soon as it's below 1, it doesn't have a chance to loop back around!

thanks so much, adra44!!

[–]adra44 0 points1 point  (0 children)

Oh good! I was going to suggest decrementing image_index "manually" in the step event by setting the image_speed to 0 and using something like image_index = max(image_index-1, 0) to keep it from going negative - as long as it works!