"Attack animation isn't working..."

Godot 4

Why is my attack animation not working? (Using both an animatedSprite2d for idle and walk and animationPlayer for attack)

extends CharacterBody2D

var SPEED = 100
var ACEL = 10

var canShoot = true
var isAttacking = false
signal laser
var INPUT: Vector2
@onready var animatedPlayer = $AnimatedSprite2D
@onready var ogHealth = GlobalVars.HEALTH

var direction: Vector2 = Vector2.RIGHT

var fireball: PackedScene = preload(“res://ballProjectile.tscn”)
func get_input():
var right = Input.get_action_strength(“RIGHT”)
var left = Input.get_action_strength(“LEFT”)
var forward = Input.get_action_strength(“FORWARD”)
var backward = Input.get_action_strength(“BACKWARD”)
if left > right:
animatedPlayer.flip_h = true
direction = Vector2.LEFT
elif right > left:
animatedPlayer.flip_h = false
direction = Vector2.RIGHT

INPUT.x = right - left
INPUT.y = backward - forward

if ogHealth > GlobalVars.HEALTH:
	animatedPlayer.play("takingDamage")	
ogHealth = GlobalVars.HEALTH
if INPUT.x == 0 and INPUT.y == 0 and not isAttacking: animatedPlayer.play("idle")
elif not isAttacking: animatedPlayer.play("run")

return INPUT.normalized()

func _shoot() → void:
canShoot = false
$cooldown.start()
laser.emit(direction)

func _process(delta: float) → void:
velocity = lerp(velocity,get_input()SPEED,deltaACEL)
move_and_slide()

if Input.is_action_just_pressed("ATTACK") and canShoot:
	isAttacking	 = true
	animatedPlayer.stop()
	$AnimationPlayer.queue("attack")

func _on_cooldown_timeout() → void:
canShoot = true
isAttacking = false