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?
4.4.1v
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")
.
Do it inside a function. Like this:
func _ready():
play("call")
assuming that that script is connected to your AnimatedSprite2D.
it works! thank you!!
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.
You can try and call AudioStreamPlayer.play()
every time you loop the animation.
Thank you for letting me know but could you give me more details, please? I keep getting errors
Can you show me your script? Create a new post for it because this post is already marked as solved.