# How do I prevent scene from activating in Unity

There is a logic to allow the scene activation later in the game after it was loaded. However, "sometimes", the scene would activate itself automatically. I tried debugging and found that the logic to activate the scene is not called at all. As a matter of fact, I use other classes that use threads to deal with networking (I'm suspecting they are the culprit). How do I prevent the scene from activating in this case?

The logic that set allowSceneActivation is in a coroutine which is called periodically every 0.2 seconds inside Update() as well. The threading parts are inside the class that gets the message, but they don't really do something inside this class. I put a breakpoint inside the part that set allowSceneActivation to true, but it wasn't hit when the new scene is activate.

What I notice is that the isDone member of the m_SceneLoadOperation is true while allowSceneActivation is still false. This should not have happened according to Unity document if I recalled correctly.

Update: Strangely, I just added a callback to Completed event of m_SceneLoadCoperation that does some logging. The symptom "seems to disappear" (Not sure because it occurred randomly). Now I'm even more confused.

Update: For whatever reasons, the symptom seems to disappear again after I update AddressableAsset package to version 1.7.5.

    private void Update()
{
{
{
};
}
if (Time.time - m_LastSendTime > 0.2f)
{
StartCoroutine(ConfirmConnection());
m_LastSendTime = Time.time;
}
{
Debug.Log("Switch to Waiting scene");
{
}
}
}

private IEnumerator ConfirmConnection()
{
yield return StartCoroutine(SendHttpGET(url));
string message = GetWebRequestMessage();
if (message == "valid")
{