How to activate running animation for my player when he is walking in the Y-axis?

I have the running animation so if the speed is greater than 0.01 it starts the running animation, but that only works for the X-axis. I know that this is probably a really easy fix, but I have been searching for about 15 min and haven’t found anything. Please help, thanks in advance! Here is the code:

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

public class PlayerMovement : MonoBehaviour
{
// Start is called before the first frame update

public Animator animate;
public float moveSpeed = 6f;
public Rigidbody2D rb;

Vector2 movement;

private void Start()
{
    animate = gameObject.GetComponent<Animator>();
}

// Update is called once per frame
void Update()
{
    movement.x = Input.GetAxisRaw("Horizontal");
    movement.y = Input.GetAxisRaw("Vertical");
    animate.SetFloat("Speed", Mathf.Abs(movement.x));

    if (movement.x < 0)
    {

        GetComponent<SpriteRenderer>().flipX = true;

    }
    else if (movement.x > 0)
    {

        GetComponent<SpriteRenderer>().flipX = false;

    }

}

void FixedUpdate()
{
    rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);

}

void Flip()
{
    Vector3 currentScale = gameObject.transform.localScale;
    currentScale.x *= -1;
    gameObject.transform.localScale = currentScale;

}

}

Simply add your y movement as you say

animate.SetFloat(“Speed”, Mathf.Abs(movement.x) +Mathf.Abs(movement.y));

Create a 2D blend tree such as the following one, then create a param X and Y.

then in your script just pass the values to the animator.

Personally I’d also drop the flipping of X from the script and just copy your walking animation and flip it in the animation window.

 public Animator animate;
 public float moveSpeed = 6f;
 public Rigidbody2D rb;
 Vector2 movement;
 private void Start()
 {
     animate = gameObject.GetComponent<Animator>();
 }
 // Update is called once per frame
 void Update()
 {
     movement.x = Input.GetAxisRaw("Horizontal");
     movement.y = Input.GetAxisRaw("Vertical");
     animate.SetFloat("Speed", Mathf.Abs(movement.x));

     animate.SetFloat("Y", movement.y);
     animate.SetFloat("X", movement.x);
     }
 void FixedUpdate()
 {
     rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);
 }