Animation frames not playing... strange discovery

Other animations I have seem to be working ok but I was stuck trying to figure out why a particular two frame animation was only playing the first frame of the animation. It’s a beat em up game and the animation was a simple front kick, which plays when a “D” key is pressed. Only the first frame played where the leg is about to be raised, but the other frame - the leg extended fully into a kick - wasn’t playing at all. I’ve followed a great tutorial by Sparckman to get so far and it’s only when I started modifying code to build my own game that I encountered this problem with the animation.

Anyway… here is the strange discovery … I just decided to add another “junk” frame to the problematic animation as the last frame, so that now it’s 3 frames. Now the animation plays the first 2 frames, but not the 3rd frame… So basically it’s “fixed” the issue but it’s still not playing all 3 frames of the animation, just 2. I know others have encountered this problem too but why would this be happening? It’s like the Gdevelop is ignoring the last frame of that particular animation every time. There must be a code I’m missing somewhere?

Hi. I’m certain it had something to do with your events, do you mind posting a screenshot of it?

I ama guessing you are using something like last frame of animation condition. It will trigger as soon as the animation is on 3rd frame, that means before the 3rd frame has a chance to render. In that case you would need to change your condition to make it run a tiny bit later.

Then it probably is not that, and it is hard to tell without events.

Hi Stoicorum, my code is probably really messy… i’ve just been following tutorials and then modifying… it’s 4 pages of events so I’ll try to post in order…

Thanks arthuro, i just posted the events. You’re right I do use the animation frame condition but it’s only to trigger the punch sfx i think… would that cause an issue with the anim playback?

This fixed it arthuro. I removed the trigger once command from where the animation 7 and animation frame 1 was set to trigger the punch sound. Now the full anim seems to play ok. Looks like problem solved. Thanks

Whoops I spoke too soon, that didn’t actually fix it. I forgot to remove the junk animation frame before testing it lol… When I removed that frame and go back to 2 animation frames, it still doesn’t play the second frame. In fact I just deleted the animation frame line completely and it still only plays the first frame of the anim

Still haven’t figured this out but I think it’s related to the “shadow is moving line”. Bear in mind that code was copied from a tutorial but then I later modified with a lot of additional code and animations. The “shadow” in this case I believe is supposed to be a platform which supports a hidden hitbox so that it doesn’t fall off screen. The player character is then attached to the hitbox and both the hitbox and shadow are hidden so only the player is visible. Any ideas appreciated.