- Home /
Intermittent crash on LoadLevelAdditive, and LoadLevelAdditiveAsync
I am experiencing an intermittent crash when loading certain levels in my project. It happens during an additive load, and I have reproduced it using both LoadLevelAdditive, and LoadLevelAdditiveAsync.
My logs indicate that during at least one of the asynchronous loads, it happened at about 27% of the way through the loading process.
In one case, the game crashed during a load where I assigned the LoadLevelAdditiveAsync method call to an AsyncOperation, and set that AsyncOperation's allowSceneActivation variable to false.
Because of this, and because of the fact that the crash also happens when using LoadLevelAdditive, I am fairly certain that none of the code in any of the scripts in the scene that I am loading can be causing the crash, since in theory none of it should have been able to execute at the time when the crash happened. Also, I placed debug statements in the Awake() methods of every script that I had written for that scene, and none of them fired before the crash happened.
Sometimes the game crashes on the first load of one of these scenes, but sometimes it takes more than 15 attempts to reproduce. Only scenes associated with one particular minigame within a much larger project cause the crash. The game never crashes or even throws an error in editor, only when built to a windows desktop app.
This is the output log from the most recent crash
Thanks in advance for any help.
Answer by Oxygame · Jul 19, 2016 at 08:03 PM
Hi @DavidMershon_BMGC. I have the same problem. Absolutely same case and the same behavoiur. Did you fixed this? What the solution. I began an open beta test of my game- and this happen on almost all hardware
I'm working on Unity 5.3.1
Answer by DavidMershon_BMGC · Jul 19, 2016 at 09:01 PM
Hi @Oxygame, I'm sorry to hear that you're having this problem. The good news is I was able to solve it.
After an extensive debugging investigation, I determined that the crash was being caused by a bug in unity's scene loading routine. Sometimes when the game tried to load a certain 3d mesh additively, the game would crash.
I was able to solve the problem by making the objects that I wanted to load into prefabs, and then loading those prefabs with Resources.Load(), instead of loading the scene they were in with an Application.LoadLevelAdditive().
Your answer
Follow this Question
Related Questions
MonoDevelop crashes when opening it 2 Answers
How to use Occlusion Culling with LoadLevelAdditive 1 Answer
build crashes 1 Answer
Why won't Unity Editor open? 8 Answers
How to force my *.exe to crash 1 Answer