Trying to get animated character to work with WASD

I got a free asset from the Unity Store to start experimenting with animations. The only issue with it is that I need to bind each of the different states to a WASD/space input. I tried to copy the animation from a cinemachine demo(video: https://www.youtube.com/watch?v=537B1kJp9YQ&t=237s) but didn’t have any luck. The character has an idle, walk, run, 2 attack states, and a death state. What do I need to change?
Here is my player controller code:

using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public float jumpForce = 7.51f;
    public bool isOnGround = true;
    private Rigidbody playerRb;
    private Animator playerAnim;
    public float horizontalInput;
    public float forwardInput;
    public float speed = .02f;
    public float turnSpeed = 10;
    
    



    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        playerRb = GetComponent<Rigidbody>();
        playerAnim = GetComponent<Animator>();

    }
    public bool shouldMove;
    public bool isMoving;
    // Update is called once per frame
    void Update()
    {
        float xDirection = Input.GetAxis("Horizontal");
        float zDirection = Input.GetAxis("Vertical");

        Vector3 moveDirection = new

        Vector3(xDirection, 0.0f, zDirection);
        transform.position += moveDirection * speed;

        if (Input.GetKeyDown(KeyCode.Space) && isOnGround)
        {
            playerRb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            isOnGround = false;
        }

        playerAnim.SetBool("IsMoving", shouldMove);
    }
    public void OnCollisionEnter(Collision collision)
    {
        isOnGround = true;
    }
}

I’m not that good with animations, but this is my solution:

using UnityEngine;

public class PlayerController : MonoBehaviour
{
    public float jumpForce = 7.51f;
    public bool isOnGround = true;
    private Rigidbody playerRb;
    private Animator playerAnim;
    public float horizontalInput;
    public float forwardInput;
    public float speed = .02f;
    public float turnSpeed = 10;
    
    



    
    void Start()
    {
        playerRb = GetComponent<Rigidbody>();
        playerAnim = GetComponent<Animator>();

    }
    
    void Update()
    {
        float xDirection = Input.GetAxis("Horizontal");
        float zDirection = Input.GetAxis("Vertical");

        Vector3 moveDirection = new Vector3(xDirection, 0.0f, Input.GetAxis("Vertical"););
        transform.position += moveDirection * speed;

        if (Input.GetKeyDown(KeyCode.Space) && isOnGround)
        {
            playerRb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            isOnGround = false;
        }
        if (moveDirection==null)
        {
        	playerAnim.SetBool("IsMoving", false);
        }
        else
        {
        	playerAnim.SetBool("IsMoving", true);
        }
				
        
    }
    public void OnCollisionEnter(Collision collision)
    {
        isOnGround = true;
    }
}

Another thing:

You made the player say: “I’m on the ground” every time his collider touches anything: this means he will be able to jump off walls. Instead, you should make a small invisible hitbox(collider) beneath the player which should check for ground.

Good luck on your game development journey.