- Home /
When changing scenes in build, game freezes but new scene runs in the background
Hi,
I have an issue when I try to load a new scene with async loading. When I load the scene in the editor, it loads in fine but when I try to do it in the build, the game freezes but the new scene runs in the background. I can hear the sounds for the new scene running in the background and the process is displayed on the task manager but the game is still frozen on the last frame of the last scene. The process still keeps running even after I close the window for the build
I am not really sure of the issue. I know the new scene is pretty process-heavy on startup but it runs fine in the editor. Any possible solutions?
do you have a script accidentally dealing with a
Time.timeScale = 0;
where it isn't supposed to be there? on that scene specific
I couldn't find any script that had that line so I don't think so
I have the same issue with my android game on my OnePlus3T with Android 9.0.1. Did you find out something?
Answer by naderlabbad309 · Feb 21, 2019 at 08:15 PM
Maybe you need loading Scene
https://assetstore.unity.com/packages/tools/dploadscreen-40690
1_Download it
2_After you create a new scene named : loadingscreen
3_ go to Folder DPLoadScreen File you downloaded you will find scene name LoadScreen Drag it to scenes in build (build scene)
4 _ take your loadingscreen you have created to (build scene) And make it the first scene at the top
5_ go to loadingscreen your empty scene and make new GameObject and make new script name: loadingscreen and put loadingscreen inside GameObject
place this inside script
void Start()
{
//nameyourscene
DPLoadScreen.Instance.LoadLevel("Name your heavy scene");
}
void Update()
{
}
}
Do not forget to put the name of your big scene
Show me results
I followed your steps and did exactly as you said. Unfortunately, no improvement. Now it only freezes on the last frame of the DPLoadScreen and the new scene begins to run in the background
can get images from the freeze in the background
Your answer
Follow this Question
Related Questions
Unity freezing when opening new scene & While building 0 Answers
High Cpu consumption on Load Scene Async 0 Answers
Scene freezes after loaded 1 Answer
How to transition from Load to scene ? 1 Answer
Scene loader Toutorial 0 Answers