In the same frame that you start the
Turn animation, it starts the
Walk animation, so it does not wait for the
Turn animation to end (or even start for that matter).
AnimatedSprite.play does not wait for the animation to finish.
To wait for animation completion you could use a
yield, but I really don't know if it'll work well in this code, can be a starting point though.
if $AnimatedSprite.flip_h == true:
The character will be stuck in place for the duration of the
Edit: Just for future reference, the
yield inside a
_physics_process is bad, because it's a "stop the world" approach, can cause a lot of bugs. What you'll probably want is something similar to a State machine, in which you go from
WALK state into
TURNING, and while in the
TURNING state you can only leave when
$AnimatedSprite.is_playing() == false.