Print/Debug.Log is not showing output on Unity Console
If print does not work, Debug.Log
will not work either so that's not the problem.
These are the possible reasons why print
is not showing in the console:
1.Script is not attached to a GameObject.
2.The GameObject the script is attached to is not Active. Activate it from the Editor.
3.The NumberWizard
script is not enabled. Enable the script.
4.The log toggle is not checked.
From your screenshot, both Debug, Warning and Error messages are enabled, so we can exclude what's in 4.
Pressing "Play"
According to this link, print()
or Debug.Log
, only will work with the following conditions
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
So you have to hit the play button above the game view, not by using the "Build & Run".
Check your filters
According to this link, you should also check your filters