this is something I use on my game
$AnimationPlayer.play("weed_lighter")
yield($AnimationPlayer,"animation_finished")
$bong_hit.play()
$AnimationPlayer.play("warning_blink")
the $bong_hit.play()
will only start playing after the "weed_lighter"
animation finishes, than another animation will play
so, yield(what, "signal")
but in your case I think something like this should work
if not $animationplayer.is_playing(yourattackanimation) :
$animationplayer.play(yourwalkanimation)
this will only play the walk animation if the attack animation is not playing
another close example from my game:
#if the animation is already playing
if icon_animation.is_playing():
#stop and reset it
icon_animation.stop(true)
#and start playing again
icon_animation.play("coffee_gone")
#if not playing, play
elif not icon_animation.is_playing(): icon_animation.play("coffee_gone")
this handles a single animation that can be called too fast and overlap, so if its called while already playing, it will start over (its just a blinking icon, so it works) but you get the idea...
you could probably get away with just a .is_playing():
check before any .play()