Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
djkp's avatar
djkp
Honored Guest
9 years ago

Scene transition causing huge drop in FPS causing black screen for Oculus game made in Unity3d

I am trying to load 2nd scene form 1st scene in a game developed for oculus VR. 
But after loading the scene2 oculus is displaying sand timer icon and black screen everywhere except for the initial view that displayed when landed in scene2.

Code I am using:

    IEnumerator sceneAsynchronousLoad(string scenename)
    {
        yield return null;

        AsyncOperation ao = SceneManager.LoadSceneAsync(scenename, LoadSceneMode.Single);
        ao.allowSceneActivation = false;

        while (!ao.isDone)
        {
           
            float progress = Mathf.Clamp01(ao.progress / 0.9f);
            Debug.Log("Loading progress: " + (progress * 100) + "%");

                        if (ao.progress >= 0.9f)
            {
                if (Input.anyKeyDown)
                {
                    ao.allowSceneActivation = true;
                    Debug.Log("Scene Changed");
                }
            }

            yield return null;
        }
    }


What should I do to resolve this?