- Home /
No answer found, but fixed via scene backup.
Unity crashes when loading a specific Scene
When i try to load a scene called MainMenu in my project, unity crashes and continues to crash every time. I have removed all my scripts and UnityVs that i installed not long before it crashed, and it still happens. I cannot tell what is causing it from the logs as they don't tell me anything useful.
I'm running on the Unity 4.6 beta. Please help me, the scene has quite a few game objects in it, but this only started after making a change to a script and saving it.
Edit: link to a crash log for when it crashes, http://pastebin.com/z0m4GfWU
Edit2: Hey i could not find an answer, my guess is the scene file got corrupted, as removing scripts and stuff changed nothing. I was lucky and had a backup of the scene from the day before and i restore that and all fine! If this happens to someone else, i don't know how to solve it :(
$$anonymous$$y best bet is an infinite loop in one of the scripts. If you are convinced this is not the case submit a bug report with the project. Its possible, but unlikely, that you have discovered a problem with the beta.
Answer by null_loop · Nov 14, 2014 at 10:23 PM
The best guess I can give you is you're doing something in AwakeFromLoad on a behaviour on a Canvas - that's adding something via Canvas.AddToManager that's causing it to crash. Like I said, something of a guess from the stack trace. Good luck finding it.
Thanks for the help, but it seems the scene file itself just caused the crash. It wasn't caused by my scripts as i even removed them from the project and the same behavior occurred. I solved it by using a very lucky backup of the scene i had from the day before!
Answer by aLovedHater · Nov 15, 2014 at 04:30 AM
Does Unity only crash when you play the scene? If so, i'm sure it has something to do with one of your scripts that are being used in that scene. I've had this problem multiple times when i edit my scripts. Often the problem that i have is that i'll have a script that spawns something into the scene or is attached to an object in the scene, and I'll accidentally mess up in my code which will make the object spawn an infinite amount of times, which instantly crashes Unity. i suggest you go through each object that has a script attached to it, uncheck the scripts attached to the object (so they dont run when you play the scene) and then play the scene. if your scene still crashes Unity then that means its a different script on a different object, or if the scene runs fine after you uncheck the script's box, that means you know the script you unchecked is what's causing Unity to crash. Once you find what script is causing the error, just go from there and try to fix it! if you have touble figuring out what is wrong with the script causing the error, feel free to post it.
But if the game crashes even if you don't run the scene than i'm not too sure what you can do.
hopefully that was of use to you!
Yeah its when the editor tries to load it. And nothing to do with my scripts, i removed them all. I even placed the scene in a different project and it still crashed. The scene file somehow got corrupted. Thanks anyway. I had a lucky backup from yesterday so i restored that.
Answer by MonemAhmed · Nov 15, 2014 at 01:26 PM
have you add your scene in build settings ? if not than whenever you tried to load that scene unity will crash and other reason would be you are using infinite loop or instantiating something infinitely in you new scene.
Follow this Question
Related Questions
Built Game Crashes But Not On Editor 0 Answers
Random crash in ntdll.dll 0 Answers
Unity Editor has stopped working" in Windows 8 0 Answers
"Convex Collider" box causing crash 0 Answers
UdpClient.receive crashes unity 1 Answer