Hello. I have a problem with using animatedsprite2d in my tutorial game. Right now, I'm trying to finish a tutorial 2d platformer project through a tutorial guide. But I can't seem to input the code for my animation to work in the game. It always gives me error: there is no animation with name ""
and this is the same for all of my animations.
I checked the guide multiple times, both the formal godot guide for animatedsprite and the original tutorial 2d platformer guide. But I still don't know what I'm doing wrong.
Here is the code:
func _process(delta: float) -> void :
change_animation()
func change_animation():
#face left and right
if velocity.x > 0:
$AnimatedSprite.flip_h = false
elif velocity.x < 0:
$AnimatedSprite.flip_h = true
if velocity.y < 0:
$AnimatedSprite.play("jump")
else:
if velocity.x != 0:
$AnimatedSprite.play("walk")
else:
$AnimatedSprite.play("idle")
and here's the link for the tutorial guide that I'm following right now:
codingkaiju.com/tutorials/beginner-godot-2d-platformer/