# Find an infinite loop in a very big project in Unity

How can I find an infinite loop in a very big project in Unity?

I tried to use breakpoints in MonoDevelop and debug, but I was not able to track the loop. I tried to put Debug.Log() in a few places and it did not help as well.

So, are there are any other ways of doing it?

It is possible that the loop is not a problem, but I think it is very unlikely. The problem is that when I perform some actions the Unity Editor just stucks and becomes unresponsive at all and I should disable it through the task manager.

• Do you have any editor scripts in Editor folder? That might be causing the problem. – Umair M Dec 10 '17 at 15:05
• What do you mean by find an infinite loop? – user100681 Dec 10 '17 at 15:05

You import it into your project, then run. Once Unity locks up in an infinite loop, hit Shift+Esc to break out of it and get a stack trace of exactly where execution was stuck. This also resumes editing without crashing, so you don't lose unsaved work.