Topic was automatically imported from the old Question2Answer platform.
Asked By
Gattsama
Hello all, just started learning Godot. Completed the dodge the creeps tutorial (twice in fact) but both times can not get the Mob animation to work?? Not sure what the problem is, the player animation works no problem. Any ideas or suggestions for what I should check??
I was running into the same issue and after looking at and comparing the Player and Mob codes I saw this line: $AnimatedSprite2D.play()
I ended up adding it here in the Mobs script and now my Mobs are animated:
func _ready() → void:
pass # Replace with function body.
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
$AnimatedSprite2D.animation = mob_types.pick_random()
$AnimatedSprite2D.play()