Sprite change to up, down, left and right depending on target location

Hello, I have a player object which I want to change it’s animation to Up if it’s target is above it Right if it’s target is beside it, and down if it’s target is below it. My player moves towards an object which follows the mouse. Here’s the code I tried where 1 is up 0 is right/let and -1 is down.

if ((mouseAim.position - transform.position).normalized.x > (mouseAim.position - transform.position).normalized.y)
        {
            animator.SetInteger("Walk", 0);
        }
        else
        {
            if (mouseAim.position.y > transform.position.y)
            {
                animator.SetInteger("Walk", 1);
            }
            else
            {
                animator.SetInteger("Walk", -1);
            }
        }

What results do you get from this code?

My sprite would sometimes change to the right when the target was below it, and some other times when the target was on the right of my object it would change to the up sprite.