Standalone player crashes when LoadLevel

Hi there,

I have some problems with Unity loading levels. My game is basically a scenario divided in two scenes. When you begin to play, the first one is present, and is not since you arrive to a trigger that the second is loaded (with LoadAdditiveAsync)

My problem comes with a “pause menu” that has a button to go back to the “main menu”. The initial code that I made to achieve this was simple. When the button is pressed:

 Application.LoadLevel("MainMenu");

And all went ok with both scenes loaded (in the editor). The problem comes when I build the standalone exe and I try to select the same option (go back to the main menu), being in the second scene, so the program crashes. The app just freezes with no reason, and no info is written in the output log.

I´ve been reading the forums, and I guess that it could be a memory issue. I tested some solutions, but even with the simplest of them, which is load an empty scene just before load the scene you want to load, I´m having the crash. The last thing I did was just load the empty scene, with nothing after, and even this make the app to crash.

The only logical reason that I think could cause this, is the scene having too many GameObjects. Could this possibly lead to some critical hiccup during the unload process (made internally by the LoadLevel)?

Can anyone give me any advice?

I don´t know what could be causing this, and trying to find the solution without any debug info is pretty hard…

Thank you so much!

Up!

Thanks in advance!

nothing in output log? did you check real player log txt or editor log? 8)
also - are you sure you added all scenes into build?

I guess is a problem of the build… maybe you did not added all the scenes into the build options. If you run the game in the Unity editor, it is fine cause all the scenes are there, but not the same in the build.

Nope! Nothing in output.log, neither in editor one. (I´ve checked both). My point is that the problem could be caused for a memory hiccup, o something like that, while Unity is unloading a scene, but it seems a bit rare situation… Anyway,thank you for your reply :slight_smile:

I am pretty sure that I have added all the scenes, in fact, the app doesn´t crash always, just randomly. Thank you :slight_smile:

Any more ideas??!!

Thank you so much!!