Fall Animation

Hello, newbie here, I have a quick question, why does the character animation work so strangely? When I jump the animation keeps switching between jump and idle and the same when landing. From what I checked on the internet I seem to have given a good condition to check if the character is falling.

private bool CheckGrounded()
{
    isGrounded = boxCollider.IsTouchingLayers(LayerMask.GetMask("Ground"));
    return isGrounded;
}

private void CheckIfFalling()
{
    float verticalVelocity = rb.linearVelocity.y;
    bool isMovingDown = verticalVelocity < -0.1f;

    if (!isGrounded && isMovingDown)
    {
        animator.SetBool("isFalling", true);
    }
    else if (isGrounded)
    {
        animator.SetBool("isFalling", false);
    }
}
private void OnJump(InputValue _inputValue)
{
    if (_inputValue.isPressed && playerController.isGrounded)
    {
        rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
        animator.SetBool("isGrounded", true);
    }
}

Hi, since I don’t have a screenshot of the Animator panel with the transitions, I can only mention that it looks a bit strange to call isGrounded = true when the character starts jumping. To be able to help any further it would be helpful to get a screenshot of the Animator panel and the transitions between the states.

private void OnJump(InputValue _inputValue)
{
    if (_inputValue.isPressed && playerController.isGrounded)
    {
        rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
        animator.SetBool("isGrounded", false);
    }
}