2

I have a normal project with about 30 Scripts and 30 Scenes (approx). When unloading any scene, it takes about 2 seconds.

For testing, I have made 2 empty scenes with 1 button each and want to transition back and forth. But again the Scene unload is taking time approx 2 seconds for an empty scene (Both scenes are empty). When I deleted other Scripts and Scenes from the Project, the Scene unloads and loads immediately. It means that in projects with minimum Assets, Unity unloads and load Scene immediately, but when project size increases, Unity takes time to unload even an empty scene. I have also tried SceneManager.LoadSceneAsync("SceneName");, but it still took time after clicking the button. What might be the problem? Does Unity takes time to unload an empty scene when the project size is large? I don't want to show loading animation or any sort of such things. I want to load an empty scene immediately even if the project size is large. Project size or number of Assets in the Assets folder must not affect the scene unloading time as scene loading time is dependent on the number of GameObjects and Scripts attached in that scene.

Junaid Pathan
  • 3,850
  • 1
  • 25
  • 47

1 Answers1

1

you shouldn't have the problem after you build the project

Safwan Ljd
  • 146
  • 7
  • Yeah, it doesn't happen in the Android build, but why does it happen in the editor? – Junaid Pathan Sep 29 '20 at 22:35
  • the project is not fully compiled when you run it in the editor so it has to load everything every time you press play, plus the editor is kinda heavy itself. – Safwan Ljd Sep 30 '20 at 02:51