Setting a bool to false using CharacterControllerHit?

I want to decide if the player is grounded or not without using the (charachterController.isGrounded) function. I have this bit:

    void OnControllerColliderHit(ControllerColliderHit hit)
    {
        if (hit.transform.tag == "Ground")
        {
            isGrounded = true;
        }
    }

Is there a way to set “isGrounded” to false if the player stops touching a collider tagged “Ground”?
Everything is working as intended, except for the lack of a “OnExit-like” function.

  • How do I set “isGrounded” to false in this case?

Try to use OnCollisionEnter, OnCollisionExit and OnCollisionStay