1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ Do you have any editor scripts in Editor folder? That might be causing the problem. \$\endgroup\$
    – Umair M
    Commented Dec 10, 2017 at 15:05
  • \$\begingroup\$ What do you mean by find an infinite loop? \$\endgroup\$
    – user100681
    Commented Dec 10, 2017 at 15:05

1 Answer 1

2
\$\begingroup\$

There's a paid ($15) asset called Panic Button that can help you track this down.

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.

I don't have any affiliation with the creator, but I can confirm it performs as advertised and doesn't introduce undesirable side-effects into the project. For the price of the coffee I'd have burned through tracking down a few of these issues, I'd personally say it's worthwhile. ;)

\$\endgroup\$
1
  • \$\begingroup\$ Holy moly, I want this asset now! Hmm, gotta make a free version of it... \$\endgroup\$ Commented Dec 12, 2017 at 7:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .