SophosMoros
Member
I cannot for the life of me figure out why this if statement continues to execute even when it's false. I'm trying to reset a sprite animation when you first switch to it and for some reason it keeps entering the first if and holding the image index at 0 instead of it running one time when you switch to the new sprite and then running the sprite index as normal. I've tried writing this in more ways than i can count and for some reason it always wants to enter that if statement that resets the image_index to 0.
GML:
if(slide == true)
{
if (move == 1)
{
if(sprite_index != spr_hero_slide_right)
{
sprite_index = spr_hero_slide_right
image_index = 0;
}
else sprite_index = spr_hero_slide_right
}
Last edited: