- Home /
Async load progress issue on Gear VR
I'm using the following snippet in my code:
void Start () {
UnityEngine.VR.InputTracking.Recenter();
TargetRoom = PlayerPrefs.GetString("TargetRoom");
LoadText.text = startText;
async =UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(TargetRoom);
async.allowSceneActivation = false;
}
// Update is called once per frame
void Update () {
LoadText.text = (async.progress >= 0.9f).ToString();
if (async.progress >= 0.9f)
{
Animator.SetTrigger("LoadReady");
}
if (!finished && Animator.GetCurrentAnimatorStateInfo(0).IsName("Loaded"))
{
StartCoroutine(end());
finished = true;
}
}
Basically, I'm running an animation while the game is still loading. once i's loaded 90%, i tell the animation to run it's last cycle and then I load the target level. I'm using a textmesh to display true when the condition is met, as a sort of debug log in VR.
In the editor, this has no issues. the animation stops, the textmesh shows true, and then the scene loads. But when I test in VR, the textmesh still shows true, but the animation never stops and the scene never loads.
I've run the code without the if statement and it loads fine (this particular level loads very quickly anyway), even in VR! so this would indicate to me that while (async.progress >= 0.9f).ToString() is resolving to "True", (async.progress >= 0.9f) isn't... but only in the gear VR. I've even had the textmesh display the value of async.progress and it will show 0.9... it just won't execute the if statement.
Does anyone know why this might be?
Your answer
Follow this Question
Related Questions
No response from AWS in android build? 0 Answers
Loading screen gets stuck sometimes 0 Answers
Progress Bar at Game StartUp 2 Answers
How to load scene when async.progress is 0.9? 0 Answers
How to avoid the white screen before Splashscreen on android mobile. 2 Answers