I'm trying to load the next scene additively like this:
string currentScene = SceneManager.GetActiveScene().name;
asyncOperation = SceneManager.LoadSceneAsync(levelName, LoadSceneMode.Additive);
asyncOperation.allowSceneActivation = false;
//Do stuff here
asyncOperation.allowSceneActivation = true;
yield return asyncOperation;
SceneManager.UnloadSceneAsync(currentScene);
But if i do this the gameObjects that should be instantiated on Start() in the next scene gets instantiated in the wrong scene (the one still active) and are unloaded when UnloadSceneAsync is called (I think this is what happens, either way my instantiated prefabs are not in the scene yet they have been instantiated)
I didn't have this issue when using UnloadScene instead of UnloadSceneAsync but i changed it because it is now deprecated.
So i've decided to not load the next scene additively but by doing so all inputs are being consumed. I've Googled this issue and people say the only solution is to load additively...
What am i supposed to do
↧