Godot Version
4.3.stable
Question
I am quite new to Godot but somewhat experienced as a programmer. I have been messing with Sprite2D and AnimatedSprite2D nodes and how they interact with the AnimationPlayer. One thing that I can’t wrap my head around is why the Continuous Update Mode is sometimes working out for me and sometimes not.
I have read the docs (2D sprite animation — Godot Engine (stable) documentation in English) and understand key framing each Sprite2D/AnimatedSprite2D frame in the AnimationPlayer.
I created a 6-frame idle animation:
and an 8-frame move animation:
in an AnimatedSprite2D.
I then carried both of these animations over a AnimationPlayer node. I watched a Youtube video on how to do this and the person in the video was keyframing every frame with Discrete Update Mode. Someone in the comments pointed out that you could instead just add the first frame at the beginning and last frame at the end and set the Update Mode to Continuous to save the trouble of adding every frame. ‘Great!’ I thought, that would be a very efficient way to do that. So I added my idle animation and everything worked great.
However, when I tried to make my move animation work, I would constantly get a “hitching” animation, where the last frame would “rush” back to the first frame. If I understand the Continuous Update Mode correctly, this is because it is interpolating from the last frame back to the first frame very quickly and so it looks janky. I tried to fix it by making the last frame only occur at the end of the animation but that didn’t help.
So my questions are thus:
- It is possible to use the technique from the Youtube comment so that I don’t need to keyframe every single frame or is this a mistake?
- If it is OK to use the technique, what are the necessary conditions of the sprite sheet to make sure it works correctly, e.g., the last sprite frame should match the first sprite frame?
- For Continuous Update Mode, should the last frame “play” for 0.1 seconds (for 10 FPS) or should the last frame be at the end of the animation time to it can correctly interpolate?