As the title says I'm puzzled why the animation wont play for me. There have been a few other posts about it but they either don't apply to my situation or I'm just too dumb to realize they do.
Basically, I have this slime character, he can face in eight directions, up, down, left, right and the diagonals.
I'm trying to play a movement animation for when he is facing a specific direction but the animation won't play with my current code, though surprisingly it will play when the character is still for some reason.
I'm hoping someone with more experience can tell me what to do to get it to play when the character moves.
Gif:

Code
`
extends CharacterBody2D
var last_pos : Vector2
var vel_vector : Vector2
var move_speed : float = 50
@onready var nav_agent : NavigationAgent2D = get_node("NavigationAgent2D")
@onready var anim_sprite : AnimatedSprite2D = get_node("AnimatedSprite2D")
#var nav_next_position : Vector2 = {100,100}
func _process(delta):
last_pos = global_position
var dir = get_global_mouse_position()
vel_vector.x = global_position.x - dir.x
vel_vector.y = global_position.y - dir.y
vel_vector = vel_vector.normalized()
global_position = global_position.move_toward(dir,delta*move_speed)
##print(angle)
print("x: ", vel_vector.x)
print("Y: ", vel_vector.y)
#print(anim_sprite.animation_changed.get_name())
#check for which quarter the sprite should be facing
if vel_vector.x > 0 and vel_vector.y > 0:
anim_sprite.play("Back Angle")
flip_left()
if vel_vector.x > 0 and vel_vector.y < 0:
anim_sprite.play("Front Angle")
flip_left()
if vel_vector.x < 0 and vel_vector.y > 0:
anim_sprite.play("Back Angle")
flip_right()
if vel_vector.x < 0 and vel_vector.y < 0:
anim_sprite.play("Front Angle")
flip_right()
#check if the sprite should be facing one of the four cardinal diractions
if vel_vector.y > 0:
if vel_vector.x > -0.293 and vel_vector.x < 0.293:
anim_sprite.play("Back")
if vel_vector.y < 0:
if vel_vector.x > -0.293 and vel_vector.x < 0.293:
anim_sprite.play("Front")
if vel_vector.x < 0:
if vel_vector.y > -0.293 and vel_vector.y < 0.293:
anim_sprite.play("Walk Side")
flip_right()
if vel_vector.x > 0:
if vel_vector.y > -0.293 and vel_vector.y < 0.293:
anim_sprite.play("Walk Side")
flip_left()
func flip_left():
if anim_sprite.flip_h != false:
anim_sprite.flip_h = false
func flip_right():
if anim_sprite.flip_h != true:
anim_sprite.flip_h = true
`