C
Coleft
Guest
How can I do that coz if I add the Sprite to an object, it will start again and again
Can you tell me which events I have to add in and which code I have to write, I'm new sorrySet image_index to image_number - 1 and set image_speed to 0 in the animation end event.
You can check the value of the variable sprite_index in the animation end event.But how do you target WHICH animation has ended? if you have an idle animation that gets switched to another animation you want to run once-- if you used 'animation end' it'll fire on every cycle of the idle animation, not just the other animation....
Or in more practical terms, something like this:You can check the value of the variable sprite_index in the animation end event.
///Animation end event
switch(sprite_index){
case spr_attackanimation1:
case spr_attackanimation2:
case spr_someotheranimationthatonlyrunsonce:
sprite_index = spr_idle
break
default: // do nothing
}