OnCollisionEnter2D won't change bool for longer than 1 update

I want to change the bool gameover to true when it collide.
But the bool gameover is only true for 1 update/frame then it returns to false, wondering why.

My code is below.

bool gameover = false;
void Start()
{
    Physics2D.queriesStartInColliders = false;
}
void Update()
{
    if (!gameover)
    {
        Debug.Log(gameover);
       //alot of other stuff that I wrote that dont make a difference
    }
}
    void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.name == "Player")
        {
            gameover = true;
            Debug.Log(gameover);
            Destroy(col.gameObject);
        }
    }

don’t declare it as false in your variables. just write

public bool gameover;

in your start method declare it as false

check it in the update method like you are

change it to true in your on collision method like you are

I think that may be all you need. lemme know what happens. but it looks that simple to me. unless you’re declaring something with the gameover bool somewhere else.