I have a scene that runs fine in the editor . . . well, almost fine; my camera isn't moving the way I thought I had scripted it. So, I would like to debug it. But if I put a breakpoint in the code while it's running, it crashes the Unity Editor. If I put the add the breakpoint before I hit play, the scene just freezes and never starts.
Does anybody know why this might be happening? One of my MonoBehaviours is multi-threaded; is that a problem?
asked May 13 '11 at 03:55 PM
First, you can't use multithreaded MonoBehaviours. Unity's scripting engine runs on a single thread. You can use threads but you can't call any Unity api from another thread.
I don't debug that much with MonoDevelop (I use Visual Studio for coding). As far as i know it's the normal behaviour that the editor freezes when you break the execution. You have to continue the execution after you're done with debugging. That's how most debuggers work. The debugged application will be interruped at your breakpoint and will freeze until you continue the application.
answered May 13 '11 at 04:18 PM