- Home /
How does unity handle Objects when changing scenes?
Imagine in scene 1 I have 10000 (imagine a big number) objects, suddenly the player decides to go to scene 2 (level 2). What happens to all of those objects. If they get gc-ed all together, will it cause a performance hiccup? If so, Do I need to have loading scene where I manually tell unity to dispose the old objects and create the new objects? And How can I do that? Thank you.
yes they get destroyed all at the same time, yes it will create a performance hiccup thats why you need loading windows for big scenes and you dont really need to tell unity anything since it will automatically destroy all old objects and instantiate the new one check this class https://docs.unity3d.com/ScriptReference/Scene$$anonymous$$anagement.Scene$$anonymous$$anager.html
Your answer
Follow this Question
Related Questions
Re-loading a scene but on the background older scenes are displayed 1 Answer
Is there any ideas to load Unity scene asynchronously? 1 Answer
Using parameters of activeSceneChanged? 0 Answers
Unity Scene loading problem (slow loading until it freezes) 0 Answers
How Do I Link Different Scenes? 4 Answers