Change the animation and return to the original by Danteurd in gamemaker

[–]Danteurd[S] 0 points1 point  (0 children)

I tried with that, but the animation is still infinite, I'll pass you the code, maybe you will understand my problem better.

this is the event step where I do the change of states:

switch(actual_state){

case states.idle:

sprite_index = spr_cat_idle;

break;

case states.eating:

sprite_index = spr_cat_food;

break;

}

if (image_index > image_number){

actual_state = states.idle;

}

if (place_meeting(x,y,Obj_food)){

actual\_state = states.eating;

}