Are you still using this code?
if timer == 2:
GoodGuy_anim.play("attack",0,0,false)
elif timer == 1:
GoodGuy.visible = true
If so, that part adds a 1 frame delay between when GoodGuy
is visible and GoodGuy
's animation plays.
The code beforehand should execute the two lines at relatively the same time.
Just for curiosity, could you try switching the timer == 2
to timer == 1
and the other one to 2
?
There will still be a frame delay using that, but I would like to know if the animation itself skips the first time or if the problem might be in another part of the code.
If the difference is that the GoodGuy
appears a frame too late but the animation plays fine, simply put them in the same timer cycle.
Exactly like you did in the first example should be fine.
if timer == 1:
GoodGuy_anim.play("attack",0,0,false)
GoodGuy.visible = true # <<< You can put this line above the animation play execution if you would prefer the sprite to be visible before the animation plays.
Let me know how it goes! :)
Ps. Sorry for the small delay in reply, I had to get a little bit of sleep haha.
Edit:
cybereality's solution is a lot simpler than mine haha. But he/she's right. It should advance to the frame specified. If 0 is specified, it would simply advance to frame 0.