Hello, i’ve got an error in my script but I cant fix it. im new to start coroutine and IEnumerator so im sorry if it looks stupid.
Error:
`Console.TypedHelp()': not all code paths return a value
Script:
void OnGUI ()
{
textfieldString = GUI.TextField(new Rect(90, 450, 200, 20), textfieldString, 25);
GUI.Label (new Rect (90, 400, 350, 100), ConsoleWindowText.ToString());
if(textfieldString.Contains("/help"))
{
Debug.Log("Typed '/help'");
Debug.ClearDeveloperConsole();
StartCoroutine(TypedHelp()); // here is the error
}
}
//Heres the error
IEnumerator TypedHelp ()
{
ConsoleWindowText = "Well Done";
}