help with animatior

currently making a game where every click reverses gravity for the game, and its working well so far, but my problem is that my player has 3 sets of animations
-running
-idle
and jumping
i am trying to get the player to play the jump animation every time a left click and when the player touch’s the ceiling or the ground i want them to start the running animation.

here is the code for reversing gravity.

private Rigidbody2D rb;

 void Start()
    {
        rb = GetComponent<Rigidbody2D>();
    }
    
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            transform.Rotate(180f, 0f, 0f);
            rb.gravityScale *= -1;
        }

Ok. I’m not going to give you the code, but I will try to give you some direction. To start with, I would add a ground check bool (usually just a box collider under the players that looks for collisions; when colliding, it is true, when in the air it returns false). Then, when that ground check is false, play the jump animation. When it is grounded, play the running animation if the player is moving. I hope this helps.