Hi guys,
I’m having some trouble with scenes and GameObjects/Prefabs within the scene not reloading properly (editor and runtime). One first load of the scene everything happens that is expected (Imgur: The magic of the Internet), on a reload whether it be from another scene or the same scene - things start to get a little hinky;
- The enemy prefabs are not instantiated at all (Imgur: The magic of the Internet) or,
- The player is completely unresponsive unless the game is paused and unpaused (Imgur: The magic of the Internet) or,
- A combination of the above occur.
To load scenes I use (depending on which scene is active):
Scene scene = SceneManager.GetActiveScene();
SceneManager.LoadScene(scene.buildIndex - 1);
SceneManager.LoadScene(scene.buildIndex + 1);
SceneManager.LoadScene(scene.name);
I have also used to load scenes (with same results) :
SceneManager.LoadScene("Menu");
SceneManager.LoadScene("Game");
Has anyone else gotten this behaviour before? If so, how do you fix it? Is it within the scene loading code that the error occurs or is it something else?
Thank you in advance!