Can someone help me with changing between my enemy character's sprites?

I can’t seem to get it to work the way I thought I could. The enemy follows the player and I want his sprite to be an animation in one of four directions depending on which way he’s going. I also want him to have a tired animation instead if he is too far from his original location. Thank you so much.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ScorpAttack : MonoBehaviour
{
    public Transform Player;
    float speed = 5.4f;
    float MinDist = 4.2f;
    int tired = 0;
    public GameObject Blood;
    private float startx;
    private float starty;
    private float totalDistance;

    int downHash = Animator.StringToHash("Walking Down");
    int upHash = Animator.StringToHash("Walking Up");
    int leftHash = Animator.StringToHash("Walking Left");
    int rightHash = Animator.StringToHash("Walking Right");
    int downTiredHash = Animator.StringToHash("Tired Down");
    int upTiredHash = Animator.StringToHash("Tired Up");
    int leftTiredHash = Animator.StringToHash("Tired Left");
    int rightTiredHash = Animator.StringToHash("Tired Right");
    int Direc = 0;
    private bool chasing = false;
    private bool hitPlayer = false;
    int tooFar = 0;
    Animator anim;

    private float currentPositionx;
    private float currentPositiony;
    private float lastPositionx;
    private float lastPositiony;
    private float changedPositionx;
    private float changedPositiony;

    // Start is called before the first frame update
    void Start()
    {
        anim = GetComponent<Animator>();
        anim.enabled = false;

        startx = transform.position.x;
        starty = transform.position.y;
        currentPositionx = transform.position.x;
        currentPositiony = transform.position.y;
        lastPositionx = transform.position.x;
        lastPositiony = transform.position.y;
        changedPositionx = 0;
        changedPositiony = 0;
    }

    // Update is called once per frame
    void Update()
    {
        if (GameManager.paused == true)
        {
            return;
        }

        currentPositionx = transform.position.x;
        currentPositiony = transform.position.y;

        changedPositionx = (currentPositionx - lastPositionx);
        changedPositiony = (currentPositionx - lastPositiony);

        if (tired == 0)
        {
            if (chasing == true)
            {
                if (changedPositionx > 0)
                {
                    if (changedPositionx > Mathf.Abs(changedPositiony))
                    {
                        if (Direc != 1)
                        {
                            Direc = 1;
                            anim.SetTrigger(rightHash);
                        }
                    }
                    else if (changedPositiony > 0)
                    {
                        if (Direc != 2)
                        {
                            Direc = 2;
                            anim.SetTrigger(upHash);
                        }
                    }
                    else if (Direc != 0)
                    {
                        Direc = 0;
                        anim.SetTrigger(downHash);
                    }
                }
                else if (changedPositionx < 0)
                {
                    if (Mathf.Abs(changedPositionx) > Mathf.Abs(changedPositiony))
                    {
                        if (Direc != 3)
                        {
                            Direc = 3;
                            anim.SetTrigger(leftHash);
                        }
                    }
                    else if (changedPositiony > 0)
                    {
                        if (Direc != 2)
                        {
                            Direc = 2;
                            anim.SetTrigger(upHash);
                        }
                    }
                    else if (Direc != 0)
                    {
                        Direc = 0;
                        anim.SetTrigger(downHash);
                    }
                }

                lastPositionx = currentPositionx;
                lastPositiony = currentPositiony;
            }
        }



        var distance = Vector3.Distance(Player.position, transform.position);

        if (tired == 0)
        {
            if (distance < MinDist)
            {
                if (chasing == false)
                {
                    chasing = true;
                    anim.enabled = true;
                }

                transform.position = Vector2.MoveTowards(transform.position, Player.transform.position, speed * Time.deltaTime);
                tooFar = 0;
                totalDistance = (Mathf.Abs(startx - transform.position.x) + Mathf.Abs(starty - transform.position.y));
                if (totalDistance > 8)
                {
                    tired = 100;
                    if (Direc == 0)
                    {
                        anim.SetTrigger(downTiredHash);
                    }
                    else if (Direc == 1)
                    {
                        anim.SetTrigger(rightTiredHash);
                    }
                    else if (Direc == 2)
                    {
                        anim.SetTrigger(upTiredHash);
                    }
                    else
                    {
                        anim.SetTrigger(leftTiredHash);
                    }
                }
            }
            else if (chasing == true)
            {
                if (tooFar < 50)
                {
                    tooFar++;
                }
                else
                {
                    tooFar = 0;
                    transform.position = new Vector2(startx, starty);
                    chasing = false;
                    anim.SetTrigger(downHash);
                    anim.enabled = false;
                    Direc = 0;
                }
            }
        }
        else
        {
            tired--;
            if (tired == 0)
            {
                transform.position = new Vector2(startx, starty);
                chasing = false;
                anim.SetTrigger(downHash);
                anim.enabled = false;
                Direc = 0;

            }
        }
    }

    private void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag == "Attack")
        {
            if (tired > 0)
            {
                Instantiate(Blood, new Vector2(transform.position.x, transform.position.y), Quaternion.identity);
                Destroy(gameObject);
            }
        }
    }

    private void OnCollisionStay2D(Collision2D col)
    {
        if (GameManager.paused == true)
        {
            return;
        }
        if (col.gameObject.tag == "Player")
        {
            if (PlayerDamage.hurt > 85)
            {
                if (hitPlayer == false)
                {
                    hitPlayer = true;
                }
                else
                {
                    transform.position = new Vector2(startx, starty);
                    hitPlayer = false;
                }
            }
        }
    }
}

I am extremely happy to report that I found the problem. In this line: changedPositiony = (currentPositionx - lastPositiony); I had currentPositionx instead of y. I’ve seen my question many times unanswered so if anyone’s looking to make an enemy face the way they’re going, this way using Mathf.Abs works perfectly. Now I just have to figure out why the sprites aren’t animated.