- Home /
Catching a Stack Overflow
My game keeps freezing ( I think an infinite loop ) at a certain point in time. However because no Stack Overflow Exception is shown its hard for me to handle the issue, and theres some doubt it is an infinite loop thats causing the problem.
Is there a way in unity to limit script execution time. For example, in Action script you can set it so that if a script executes for longer than x seconds, that it should stop the script. Is there a way to do this in Unity, or can someone suggest a way catch a potential infinite loop.
Answer by whydoidoit · Nov 08, 2012 at 02:33 PM
When your game freezes attach MonoDevelop to the Unity Editor using the Run->Attach menu. Then click on Run->Pause and you can inspect where the game is at the current time using the call stack.
Thank you so much @whydoidoit it's worked!
In Visual Studio 2019 After Run->Pause you can inspect where the game is at Thread $$anonymous$$enu The bottom one is current
Your answer
Follow this Question
Related Questions
Is this loop infinite? 2 Answers
Ping Pong Ball break infinite loop 3 Answers
Infinite Looping Crash 2 Answers
'brake' statement makes Unity hang ? 0 Answers