Animation is stuck on first frame, how to fix that?

Hi all,

I’ve run into a problem with some of my animations. Not all of them play as they should, only their first frame is played then they are stuck.
I’ve tried to look up the solution on the forum but similar problems did not give me an answer to mine, so please help me if you can.

From this list, for example, jumping, falling and dashing only play the first frame.
I thought there might be a connection between them not being in loops but I do not understand how would that matter.

Thank you for any input or ideas!

Hi heltee,

When the animation seems to be stuck on the first frame it can be an indication the actual animation is being forced to restart constantly (which make it look like it’s stuck on frame 1).

If this is the case there might be 2 or more actions (animations) that are conflicting with each other forcing each other to reset.
For example, the player is jumping so the logic is to play the jumping animation, however further down the event it might also detect the player is falling so the logic is to play the fall animation. However this then stops the jumping animation from playing and the fall animation doesn’t get to play either as it’s stopped from playing in the next fame (or logic loop) by the jumping logic etc.

I’d suggest adding some debugging to your events to see exactly what is being triggered. There are multiple ways todo this but I find just logging something to the console works great.

In your actions, type in console and you should find the message option.
image
Add some text you want to appear and make sure its in the same logic area as your animation.

Now run a preview of your game and then when it loads press Ctrl + Shift + I to open the inspector and navigate the the console area and now you can see what is being triggered.
image

As you can see, it seems with just the basic checks (replicating your image) that the falling AND jumping is both being called in the same frame resulting in neither animations being played in full. To fix this you’ll need to look into adding more checks (eg jumping but not falling) or more advanced ways of handling this logic such as FSM.

image

Good luck on your adventure!

3 Likes

Wow, okay, thank you, I will definitely try it and report back what the problem! <3

1 Like

So, I am reporting back. So far so good, I could fix some of the problems with the help of the debugger and extra conditions. In other cases, the animations themselves were not a good fit, like being too long for certain actions.
But nonetheless, I am grateful for the help and insight @BigChalkGames ! I’ve learned a lot from this :smiley:

1 Like