Make bool only true if colliding right now?

Hi. I am trying to make a bool a stay true as long as object a collides with object b.
After that, object a will immediately collide with object c, bool a should become false and bool b should become true.
Unfortunately after object a collides with object b, bool a stays true.
How can I achieve that bool a becomes false after object a isn’t colliding with object b anymore?
I hope I made clear what I want to achieve. :slight_smile:

Here is the code so far:

`void OnCollisionEnter2D(Collision2D coll){
      if(coll.gameObject.tag == "Blue"){
            if(isBlue){
                colorIsMatching = true;
                isBlue = false;
            }
        } else if(coll.gameObject.tag == "Pink"){
            if(isPink){
                colorIsMatching = true;
                isPink = false;
            }
        } else if(coll.gameObject.tag == "Violet"){
            if(isViolet){
                colorIsMatching = true;
                isViolet = false;
            }
        } else if(coll.gameObject.tag == "Yellow"){
            if(isYellow){
                colorIsMatching = true;
                isYellow = false;
            }
        }
    }`

Try using OnCollisionExit