P
Pitu
Guest
Hey, so i've run into a bit of a problem, I've fixed this before but i haven't programmed GML for a long time so I don't remember how to do it. So my problem is that when I want to move left, the left animation should play (animations are all done in the sprite editor) but it only plays the right animation and the idle animations. Also the key_left && key_right makes him stand in place but move to the right, no sign of any left animations, PLEASE FIX MY CODE!
Code:
if(key_right && !key_left){
sprite_index = player_movingright_spr
}
if(key_left && !key_right){
sprite_index = player_movingleft_spr
}
if(key_left && key_right){
sprite_index = player_idle_spr
}
if(!key_left && !key_right){
sprite_index = player_idle_spr
}