AnimatedSprite

The player spritesheets are displayed by an animated sprite, it contains an animation for every spritesheet of the player.

How to add a new spritesheet

Add a new animation in the animation player, then add a callback track to call the method change_spritesheet in the script of the animated sprite (add the animation name as the arg).

Set the new animation in the animation tree.

Lastly, add a new animation in the animated sprite, the animation name must be the same as the one in the animation player (do not forget to set if the animation of the animated sprite loops), then add the frames of the new spritesheet in the animated sprite’s animation.

Why use a method track instead of signals?

Due to a bug (only fixed in Godot 4) the animation player will not send signals if the animation was set by an animation tree.

So, it is a track of the animation player that changes the animated sprite’s animation by calling a method in its script (change_spritesheet)

Why we are doing this?

The previous approach was to have a single spritesheet containing all the player animations.

In the player's animation player, each animation changed the frame index of a sprite.

Every time the spritesheet was changed, we had to change all the values of every frame in every animation. This was unsustainable.