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.

1 Like

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

Welcome to the community, great to have you!

One thing you might have missed is that I did describe a solution to use an AnimationPlayer together with an AnimatedSprite3D in my original post, to counteract precisely the problem you described. If the AnimationPlayer controls the AnimatedSprite3D, you can add any of the usual track types to the AnimationPlayer, while still benefiting from the easier frames setup vs. a regular Sprite3D.

Also, if you are new to Godot, maybe it is more advisable to stick to the lecturer’s approach even when you don’t like some aspects. If you ever run into a bug that you can’t seem to solve, it is easier to compare with the solution from the video and the linked Gitlab if you didn’t introduce too many deviations. You can always apply different approaches to the finished project or in anything you create later.

Good lookin’ out. This lecture demo would be a completely unreasonable workflow when considering a game that might have dozens of characters with several animations each, all running at 30 or 60fps. I don’t mind a lack of sprite sheets–image sequences are easier to generate, anyhow–but all that manual entry would be a dealbreaker. Is there not even a shortcut to move the playhead forward and backward? I keep trying to use After Effects shortcuts because they’re burned into my muscle memory. :sweat_smile:

On Windows, Ctrl-Left/Ctrl-Right seem to move the playhead forward/backward one step. In addition, the playback control buttons have their hotkeys in their tooltips. Maybe this helps.

1 Like

This is a very slow, time consuming way of doing this. Why was this not done using a sprite sheet?

Privacy & Terms