GreenHell Modding
Search…
Printing to the console
To print to the console we use the unity Debug class as shown below.
1
Debug.Log("This is a simple log.");
2
Debug.LogAssert("This is an assert...");
3
Debug.LogError("This is an error...");
4
Debug.LogException("This is an exception...");
5
Debug.LogWarning("This is a warning...");
6
Debug.Log(new Vector3(0,0,0));
7
Debug.Log(myvalue);
Copied!
When using the System namespace its Debug class might do some weird stuff. You can use UnityEngine.Debug.Log() or simply add using Debug = UnityEngine.Debug; at the top of your class after the imports.
Last modified 1yr ago
Copy link