Alternative with AnimatedSprite3D

When we were dragging the sprite images around one by one, I thought “There must be an easier way to make breakfast”, and I found one I like better.

A case like ours, where we have a bunch of image files instead of a single sprite sheet image for an animation, seems to be better supported by the AnimatedSprite3D node. It takes sprite animations via a SpriteFrames resource. (In the other case, plain Sprite3D would offer features to split the sheet that we now cannot use.) In the SpriteFrames editor we can bulk-drag all the images for one animation into the Animation Frames panel at once. To play the animations, we would not need an AnimationPlayer then.

But since I expect we might add more animation tracks later (e.g., sound and particles for footsteps), the playback of the AnimatedSprite3D can still be controlled via an AnimationPlayer. I set mine up so that one track sets the animation to be played, another track just does linear interpolation over the frame property, from the first to the last frame number.

I think this approach might be less effort to set up and to maintain, but it depends on the situation.

AnimatedSprite3D docs

(Concerns lecture Adding Player Animations from the Godot 4 C# Action Adventure course.)

2 Likes

I hope this gets easier (quicker) in later lessons. Creating and setting up each keyframe one by one is a real pain. I’m losing interest already. Hopefully, once we get past the 2d-ish 3d sprites, animation will be more intuitive.

This is exactly what I want to ask as well. Thank you for the perfect comment and also for the proposition of a possible workflow.

I would like to hear if there is a reason to do it like it is described in the lecture or if what @daberny proposed is the more efficient and time-saving way to do sprite animations without any limitations later.

Therefore, my questions are:
Why are we using Sprite3D + AnimationPlayer instead of AnimatedSprite3D?
Also, why are we using a bunch of image files instead of a single sprite sheet?

Thank you

I used the AnimatedSprite3D option as well, for the same reasons. Not a big fan of manually adding keyframes to stuff if I can help it.

I noticed one potential wrinkle if you go this route: it doesn’t look like you can add method tracks to it the way that you can with AnimationPlayer. This came up in a later lecture - I was unable to make a suggested adjustment to the death animation when we got to it. I decided I didn’t really care enough about the visual effect to change over. However, if you wanted to synchronize a function call with, like, swinging a sword, I think you’d have to do it the way the course suggests instead, and I might still switch back to AnimationPlayer later for that reason.

Disclaimer: pretty new to Godot and might’ve missed something here.

Privacy & Terms