I have a sprite with 5 animation frames, each a different color;
What i would like to do is select the a frame (from 0 to 4), based on a value from 0 to 100;
so, if the value is 0-20, choose frame 0;
if the value is 21-40, choose frame 1, and so on all the way up to 81-100;
It feels that I should be using a statement with 'clamp' and modulus%20 to select the frame, but i can't figure out how;
BTW, I know I can choose multiple if/else statements, but I think it can be done more efficiently;
thanks;