I have many routines that output to Debug.Log. They are all in order. First function 1 runs, then 2 all the while outputing to the console the information about the functions. IF I just run function 1 and 2 I get output to the console. But for some reason if I run function 3 which has a long loop, all the Debug.Log's are not written to the console, as if they can't be written while a loop is going on. So I can't debug the loop. So what's happening is it stored in a buffer which is not released during a long loop? If I make the loop smaller it works fine. But as it gets larger it totally hangs up unity3d. If I take out the Debug.Log calls it also runs fine. ??? Dan
I think the Debug.Log calls are buffered until the end of the frame update. A tight loop will be delayed by the calls, but they won't be displayed until the end of the frame.
If you want utilized a long loop function, you should use a Coroutine function. For Example : Code (csharp): .... StartCoroutine(Function3()); .... IEnumerator Function3() { while (true) { ..... Debug.Log("1 CheckPoint"); yield return new WaitForEndOfFrame(); ..... Debug.Log("2 CheckPoint"); yield return new WaitForEndOfFrame(); } }