- Home /
Editor freezes after play
I have been having an issue with the Unity editor freezing 100% of the time when I play the game (regardless of starting scene it seems) and then end it gracefully by pressing the play button. The next time I either try to play it or quit via the menu after this Unity will just stop responding and I have to perform a force quit from activity monitor.
I am using Unity iOS Pro on an iMac (build targeted at iOS). I have opened other projects and it seems only this specific project has this behavior. I've tried both re-installing Unity and deleting and re-downloading my project from our version control and neither have helped.
Has anyone experienced anything like this or have any advice to offer?
Thanks in advance.
EDIT: Upon further inspection it just hangs for maybe 3 minutes, rather than freeze, so if I let it sit long enough it will eventually begin playing (although it is faster for me to just kill it and restart it). Also as a clarification I am able to run it the first time without incident, I only experience the hang on every attempt to play beyond the first.
Answer by mpavlinsky · Jan 04, 2012 at 09:05 PM
It turns out this was because there was a coroutine hanging indefinitely because our webserver had changed addresses. An update to the correct URL was all that was needed.
$$anonymous$$ight want to add a timeout/fail state to that ;)
Heh, I agree. Is there any elegant way to handle timeouts other than subclassing WWW to have a timer?
Answer by Rod-Green · Jan 03, 2012 at 11:53 PM
This could be an issue with one of your scripts. Does a blank scene cause the freeze also?
Unity serializes the scene on play and you may have some kind of infinate reference or something else it's getting stuck on.
Way to check - comment out, delete scripts until it works again. Find the script that is stopping it and post it back here for help on the issue.
Answer by saberboy117 · Jan 04, 2012 at 06:16 PM
It could also be error reports, if you have somthing that is producing a ton of error or print messages a second it tends to freeze mine for the most part, try using yeild;
to restrict scripts like that.
Yeah I have had issues in the past with Debug spam causing issues, particularly on iOS hardware which ends up causing a 'broken pipe' error.
I believe that's not the case here because there is not a ton of spam in the console as it is hanging (save for a handful of warnings), and when it has finally started there is only one message I have logged.