I'm writing some C# scripts for a Windows Standalone application in Unity. I'd like to print some debug messages to the Unity console, but I can't figure out how. I've read that I should be able to do this using
I'm new to both Unity and C#, so don't hesitate to mention potential solutions that should be obvious enough for me to already have tried them :)
For the consolation prize...
As a workaround, I've been using BareTail to watch the log file, but it kinda sucks because Unity outputs the whole stack trace every time I
It seems that the key piece of information I was missing was that Debug.Log writes to the console only when you run the game from within unity by pressing the "play" button above the game view.
I was running my game by pressing Ctrl-B, or pressing "Build & Run" in the Build Settings window. In that case, it will only output to the log file.
answered Aug 26 '10 at 09:18 PM
print is an alias for Debug.Log, which does appear in the Unity console. There's also Debug.LogWarning and Debug.LogError, which (strangely enough) print lines labeled as warning and error messages. The latter is particularly useful if you have Error Pause selected in the console.
answered Aug 17 '10 at 10:28 PM