I've just written some code and trying to test it using Unity Remote my new code is being triggered by a touch and then the entire Unity iPhone is stopping responding.
I have to force quit and restart it, thankfully the first time this happened most things were already saved.
I've started trying to add debug logs to see how far it gets before it crashes, though this is a little tedious as i can only see the last line output. Would prefer it if i could look at a text file of the log output. It's added to the console logs actually isn't it?
Anyways just wondered if anyone has seen this happen, any tips for things likely to crash it?
I do think it'd be nice if the play session could crash without taking down the entire editor but still i can appreciate how things could be getting a bit messy.
What do you mean only one line? You mean the output that appears at the bottom left of the Unity window? Why don't you just hit shift+cmd+C to bring up the console window? That shows all your output using print or Debug.Log.
Answer by jimbobuk
Dec 07, 2009 at 08:34 PM
I managed to figure out where the crash was. An infinite loop caused by self recursion.
I'd still like to hear more expert advice on this but for anyone else, if you experience the entire program hanging then an infinite loop may be causing this. Something like this will cause it
Answer by Jaap Kreijkamp
Dec 09, 2009 at 03:10 AM
Yes, unity hangs if you create function that doesn't return. The same holds (and is trickier to find) for Coroutines, if a coroutine loops and never yield you're in big trouble as well.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
Debug.Log doesn't work properly in a ContextMenu function
really slow editing script parameters in unity editor (iphone)
Using git on scripts - Why do i have to keep setting project permissions on launching unity?
How can I find editor log file?
How to get rid of the crash error in MonoDevelop