Hey so I am trying to change a bool based on whether a gameobject is in c collider that is set as a trigger. The problem is that my code works to set my bool to true but it does not set back to false when it is not in the trigger.
void OnTriggerEnter2D(Collider2D ground){
if (ground.gameObject.tag == "ground") {
Debug.Log ("I'm colliding with ground");
onground = true;
} else {
onground = false;
}
}