I am loading a scene from an asset bundle. Everything was working fine, but then I switched to loading the scene additively and now I'm getting a strange exception when I try to set the scene active.
Here's my code:
IEnumerator LoadSceneCoroutine(string pSceneName){
yield return SceneManager.LoadSceneAsync(pSceneName,LoadSceneMode.Additive);
Scene chapterScene = SceneManager.GetSceneByName(pSceneName);
SceneManager.SetActiveScene(chapterScene);
}
I get an exception:
**ArgumentException: SceneManager.SetActiveScene failed; invalid scene**
What does this mean? What about my scene is invalid? Are there certain requirements that must be met for a scene to be set active? A google search for this error returns almost no results and the documentation is not helpful either so I'm stumped. Please help! Thanks.
↧