My code I just pass into the animator a bool for if the player is walking or not. And if the player is walking then I pass in the X and Y or its directions to the animator's floats X and Y which are used by the blend tree. I'm using two blend trees as you can see. One for idle and one for walking
Vector2 direction;
[SerializeField] float playerSpeed;
Animator animator;
private void Update()
{
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");
direction = new Vector2(horizontal, vertical).normalized * playerSpeed;
animator.SetBool("Walking", direction != Vector2.zero);
if (direction != Vector2.zero)
{
animator.SetFloat("X", horizontal);
animator.SetFloat("Y", vertical);
}
}