I’m loading a scene using data from a file, which instantiates objects after the scene has been loaded. After instantiating these objects, I call LoadScene on the same scene which should theoratically reset the scene to its state before instantiating the objects. However, I end up with the scene having two copies of the instantiated objects. Why is this happening?
Are you using DontDestroyOnLoad or loading the scene ‘Additively’ ?
My scene loading mode is set to Single, and the only DontDestroyOnLoad objects I have are my game manager and player, both of which are singletons. The trees do not have DontDestroyOnLoad on them.
I have figured out the reason for the problem. I did not remove the listener for loading objects that I added to the OnSceneLoaded event, hence causing multiple spawns.