- Home /
Unity is freezing on certain Scene!?
Hey, im having abit of difficulty, i have spent ages working on this scene for my game, and now whenever i open it, even through another scene, Unity instantly freezes. Im not sure what to do because i have put alot of time and effort into this and now it is as if it was never there. If anyone has has this problem or knows of anyway to help it would be greatly appreciated :) Thanks in advance!
are you using any infinite loops in your scripts, or do you have any really complex game objects?
no, i've just checked and i have no loops, and the most complex game object is the character controller? :/
Do you think it's just something in the scene, or a problem in a script? If you are instantiating any prefabs, check them in the project folder to see if they show up blank in the inspector. If they are then I think they are corrupted, just happened to me earlier today.
thank you, i will check now, but im not sure how to because i cant open the scene or do you mean check all prefabs in the project inspector? :)
Answer by ArkaneX · Sep 22, 2013 at 01:05 PM
Without seeing your code, it is very hard to help. What I can suggest, is troubleshooting by commenting parts of code. This will of course generate errors, but should help in finding the cause of problem.
I think the best way is commenting all of your code at once (methods in classes should suffice). After doing this Unity should not freeze (if it does, then I would be very confused...) Next step would be uncommenting half of the methods and check if problem occurs, if not - uncomment half of those still commented, check, etc.
Before doing the above, do a full backup of Unity project. If you find a cause of problem, you can restore backup and just fix a specific part of your code.
thank you, i will try this!And it may be time consu$$anonymous$$g but it will be much quicker than restarting, also if i edit the scripts in the project inspector would it change them in the hierarchy? Because i cant get on the scene so i will need to edit it from another one? :) - Thank you so much!
I thought about commenting code in notepad/$$anonymous$$onoDevelop or any other external editor. You don't have to change anything in the inspector.
After initial comment I described, you should be able to open the scene in Unity. If not then problem is not related to scripts and my method will not work.
One more thought - please double check if names of your classes match exactly the names of your script files.
Okay so i commented all my scripts, then i opened the scene and it worked, but after around 5 $$anonymous$$uets it suddenly froze again and now it wont work (the scripts are still commented)?
Okay, it's working now thank you all! For anyone who is using GUIText (the gameobject) and this happens, just put the size to around 100 or lower and scale it larger if need be, thats what is working for me now :)!
Answer by Precache · Mar 30, 2017 at 03:08 AM
This has happened to me a couple times. I'll load a scene I haven't touched in a while and Unity will lock-up.
So far deleting my library folder always fixes the problem (it's a good idea to backup first). "Library" contains a lot of generated files that can cause Unity to fail, deleting it forces Unity to do a clean build.
They really ought to put an option to do this in the project loading screen. Or prompt you if you want to do it anytime you don't exit cleanly (the next time you start).
Answer by meat5000 · Sep 22, 2013 at 01:47 PM
First thing to do is BACKUP YOUR PROJECT.
Then delete you project settings file.
Report.
i would but im a bit new, how would i back it up? is their a button inside unity or should i just save the file with another name? - thakyou inadvance
Backup might be just a copy of your whole project folder.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
A node in a childnode? 1 Answer
Unity is stuttering.. every 1.5 seconds about. 4 Answers
I cant import anything from the asset store! 0 Answers
gyroscope script problem. 1 Answer