Stack Traces Good Buddy??! How to find an error help.

Hi there,
I recently disciovered how to use StackTrace to get the function that called this fucntiuon. You can see the method here if needed (http://forum.unity3d.com/threads/192651-Knowing-How-To-Know-What-Function-Called-Function-Help). What I am wondering is, I am getting a few not so much random errors, but freezes, at certain points. While I know it occurs when A hits B, I can not figure out why.

What I am wondering is, there a similar function to stack trace that can point the root of a freeze out?

Thanks

Bizzity bump.

What do you mean when you say “freeze out”? Your framerate drops dramatically or the game actually hangs as if in an infinite loop? There’s no code-centric way to resolve this because it’s your code that is causing it. There’s no mechanism in code to say “if I’m stuck in an infinite loop do this”.

public void Start()
{
    while (true)
    {
        // this will cause your game to freeze
        // and there's no way to "register" it because the
        // execution is stuck in this block
    }
    // this will never get called
    Debug.Log("Done");
}

If you have Pro you can profile your game to get an idea of what is causing high memory consumption or taking a long time to execute. You can also attach a debugger to the Unity process in order to step through your code if you can narrow down the event in the game that is causing it. Beyond that you’re in the business of placing log statements at various points and reviewing the log output afterwards or, if the slow down is causing some kind of exception to be thrown, there should be a stack trace attached to that exception that you can review.