- Home /
Debug.Log results in no output?
Hi there, I'm pretty much a complete beginner to Unity so hopefully someone is patient enough to help me through this. I'm writing a unity based javascript script in order to do some operations and math. My script looks something like this.
function Start () {
Debug.Log("TEST");
//Create character array to hold the raw data.
//Code that is not relevant for this question
}
I've added a Debug.Log operation just so I can 'see the script in action' as it were. When I open my script in MonoDevelop, and hit Debug (that is, hitting f5), the code compiles, it links to an instance of Unity, it seems to run... and then I get nothing. No messages, no "TEST", nothing.
I would expect to see "TEST" somewhere in the Unity Console - based on what I've seen on these forums and from discussions with others.
Is there something basic I'm doing wrong? Should I be looking in a different window, or running MonoDevelop differently?
Answer by Eric5h5 · Nov 13, 2012 at 03:27 AM
Save the script, then switch to Unity and click the "play" icon. Also the script must be attached to some object. Don't use debug in Monodevelop unless you actually need to run the debugger.
Ah, figured it would be something simple like that. Thanks for the aid!
Answer by traveler · Jan 03, 2014 at 10:22 PM
Out of desperation, I poked around in the console window and found that you need to click the Collapse tab on the left top of the console window before Debug.Log or print will work. Of course, I am working on an Android touch screen example. I haven't tried it on a Windows example yet.
Thank you for this answer! This was the only thing that worked for me.
Answer by peidaqi · Jun 01, 2016 at 02:43 PM
Just to add to the probable solutions - I had the same problem and nothing above worked, until I tried "Window - Layouts - Default".
Seemed to be a weird bug (as of 5.3.5f1 Personal Edition) - though I cannot seem to recreate it either.
Answer by sbethge · Sep 12, 2019 at 12:18 PM
Another possible issue is that the little speech bubble with the exclamation mark on the right in the console tab is not toggled. That solved it for me.
O$$anonymous$$G! I spent so long thinking my script was broken when I had just unclicked that bubble at some point! Thank you so much!!!
Your answer
Follow this Question
Related Questions
How to use Application.logMessageReceived for logging ? 3 Answers
Reopen development build console 1 Answer
How do you get OutputDebugString to show up in the Visual Studio output window? 0 Answers
Debug Wrapper Class 6 Answers
Is it possible to access the previous UnityPlayer.log file at runtime before it get's overwritten? 0 Answers