Which sprite is better to create animation

Godot Version

4.4.1v

Question

I want to create an animation with sprite node. Which is the better, AnimatedSprite2D or sprite2D?
if animatedsprite2d is better, what should i do?

I mainly use AnimatedSprite2D for animated sprites. You can add multiple animations in one AnimatedSprite2D and then play the specific animation you want using $AnimatedSprite2D.play("animation_name").

1 Like


What’s causing the error?

Do it inside a function. Like this:

func _ready():
    play("call")

assuming that that script is connected to your AnimatedSprite2D.

1 Like

it works! thank you!! :slight_smile:
If I can ask more questions, could I also ask about how to use an AudioStreamPlayer node with a Sprite2D animation? I’ve already made the sprite loop three times, and I want the audio to repeat three times to match it.

1 Like

You can try and call AudioStreamPlayer.play() every time you loop the animation.

1 Like

Thank you for letting me know but could you give me more details, please? I keep getting errors :frowning:

Can you show me your script? Create a new post for it because this post is already marked as solved.