[SOLVED] According to "print" message boolean variable turns true but if statment doesn't do stuff.,

I need an if statment to Start Coroutine so I create one. And it doesn’t working. After I use print function to see the boolean variable really always false. I see it turns true normally. But still if statment doesn’t do stuff. This is code (in void Uptade):`

    if (p1.calisti || p2.calisti2)
    {
       
        if (oynat) return;
        else
        {
            StartCoroutine(OyunBitti());
            oynat = true;
        }

    }`

Here is the output of print(p1.calisti) in void Uptade:


I am noob. Sorry, if I miss little thing. Thank you.

,

My Solution: I change “if(p1.calisti || p2.calisti2)” statement’s method Uptade to FixedUptade.Because in Uptade method statment called only once. But in FixedUptade (or LateUptade) it works very well.

Well i dont know what your code says - and i’d need to see more to be able to understand it. But im sure you’re aware that the method returns - so if is already true then it would just not start the coroutine - however, since you have said it to false- then it runs and starts a coroutine, basically a thread, and sets it to true - maybe its the order in which you do things? Try put the true before the coroutine? Just a guess.

But again, without seeing more thats my best guess