Can't seem to get my animations to work proper

So I’m working on a game that has the player movement in the style of a 2D RPG and I have walking animations setup for when the player is facing in each direction (up, down, left, right). I wrote my script and it make the player face in those directions but I want to make it so when you try to go diagonally it just does the animation for walking on the horizontal axis. So for example holding the up and left keys makes the player walk in the north-west direction but I want just the left walking animation to play rather than it rapidly switch between the up and left animations. I’m really stumped on how I should go about writing the code for this so it works how I want. Here is the script that I wrote for my character movement and playing animations:

using UnityEngine;
using System.Collections;

public class player_movement : MonoBehaviour {

    [SerializeField]
    private float speed;

    private Animator playerAnimator;
    private Rigidbody2D playerRigidbody;

    void Start()
    {
        playerRigidbody = GetComponent<Rigidbody2D>();
        playerAnimator = GetComponent<Animator>();
    }

    void FixedUpdate()
    {
        float horizontal = Input.GetAxisRaw("Horizontal");
        float vertical = Input.GetAxisRaw("Vertical");

        HandleMovement(horizontal, vertical);
        Facing(vertical, horizontal);
    }
    
    void HandleMovement(float horizontal, float vertical)
    {
        playerRigidbody.velocity = new Vector2(horizontal * speed, vertical * speed);
    }

    private void Facing(float vertical, float horizontal)
    {
        if (vertical > 0.1){
            playerAnimator.SetFloat("up", 1);
        }
        else{
            playerAnimator.SetFloat("up", 0);
        }
        
        if (vertical < -0.1){
            playerAnimator.SetFloat("down", 1);
        }
        else{
            playerAnimator.SetFloat("down", 0);
        }

        if (horizontal > 0.1)
        {
            playerAnimator.SetFloat("right", 1);
        }
        else {
            playerAnimator.SetFloat("right", 0);
        }

        if (horizontal < -0.1)
        {
            playerAnimator.SetFloat("left", 1);
        }
        else {
            playerAnimator.SetFloat("left", 0);
        }

    }
}

If someone could tell me how I should be going about this I would really appreciate it. I’m just getting started with scripting and I’m still really new.

try this instead and let me know if it works or not

     private void Facing(float vertical, float horizontal)
     {
 
         if (horizontal > 0.1)
         {
             playerAnimator.SetFloat("right", 1);
             playerAnimator.SetFloat("left", 0);
         }
 
        else if (horizontal < -0.1)
         {
             playerAnimator.SetFloat("left", 1);
             playerAnimator.SetFloat("right", 0);
         }

         else{
                if (vertical > 0.1){
                      playerAnimator.SetFloat("up", 1);
                      playerAnimator.SetFloat("down", 0);
                }
         
                if (vertical < -0.1){
                      playerAnimator.SetFloat("down", 1);
                      playerAnimator.SetFloat("up", 0);
                }
          }
     }