GML Using Image_Index/number but referring to a different sprite?


I'm trying to make an animation work based on it's image_number (amount of frames in the animation) but it doesn't work because it instead starts by referring to the current sprite's image_number, and not the actual animation it plays just after.

canshoot = image_number;
How do I write this to refer to a different sprite's image_number?


Sounds like you're doing something weird that could probably be achieved easier a different way.

Robs got the simple answer above tho.

However you could always store the current sprite in a variable, then switch the sprite_index to the desired sprite to do your checks and then revert back to the old sprite after.