For Unity beginner with C# syntax - part1 - Debug.Log();

 For Unity beginner with C# syntax - part1 - Debug.Log();


syntax:
Debug.Log(string s);
description:
string s will be outputed in Unity Console.

common issue:
Q:Why did not see string s in Console?
A:
Check if the string s is outputed in Console or not.
1.Maybe you just did not select the output mode. It will be outputed but you can not see it.

output mode was selected.



output mode was NOT selected.
but the message was outputed.



If it is not outputed.
2.Check the script,  check the script is attached on the object. If the script is not attached, the script will not be executed.
you can check it through Hierarchy -> object you select ->Inspector 
Logic error
3.Check that the Debug.Log(s); was called.

I recommend that test a script at beginning.
such as 
void Start()
{
Debug.Log("Hello Unity");
}

ByeBye~~

Comments

Popular posts from this blog

GameObject.SetActive() v.s. GameObject.active

output message to Unity Console - Debug.Log() v.s. Debug.LogWarning() v.s. Debug.LogError() v.s. print()