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.
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
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.
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.
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.