Animation freezes because it's trying to play a different animation

Godot Version

Godot 4


I’m trying to get two different types of animations, one where your strafe slowly, and the other where you strafe quickly. There are two types of animations, Strafe L and R and Strafe Sprint L and R, and two types of inputs. A and D normal and A and D with Shift attached. I think that the normal strafe is trying to play and is freezing the Sprint Strafe animation. I’m not sure how to stop a specific animation from playing but idk if this is common knowledge as I just started getting into Godot so help would be appreciated

Here is my code:
extends Node3D

@onready var animation_player = $AnimationPlayer
var Running = 1
var Crouching = 1

Called when the node enters the scene tree for the first time.

func _ready():
pass # Replace with function body.

Called every frame. ‘delta’ is the elapsed time since the previous frame.

func _process(_delta):

func Run_Set():
if Input.is_action_pressed(“Sprint”):
Running = 2
Running = 1

func animations():
if Crouching == 1:
if Running == 2:
if Input.is_action_pressed(“Sprint”):“Locomotion-Library/run”)
if Running == 1:
if Input.is_action_pressed(“Sprint Left”):“Melee-Library/StrafeRunL”)
if Input.is_action_pressed(“Sprint Right”):“Melee-Library/StrafeRunR”)
if Input.is_action_pressed(“ui_left”):“Melee-Library/StrafeR”)
if Input.is_action_pressed(“ui_right”):“Melee-Library/StrafeR”)
if Input.is_action_pressed(“ui_up”):“Locomotion-Library/walk”)
if Input.is_action_pressed(“ui_down”):“Locomotion-Library/walk”)
if Input.is_action_pressed(“Crouch”):
Crouching = 2

if Crouching == 2:
	if Input.is_action_pressed("Crouch"):