GUI Text Shows in Editor But Disappears at Runtime

Hey everyone, hoping someone can help me with this odd problem.

I have a system wherein I draw a box in the game and put some tutorial text in it, using the following lines of code:

		Rect descBoxRect = new Rect(viewPosition.x, (Screen.height - viewPosition.y), width, height);
		GUI.Box(descBoxRect, tutorialPrintText, tutorialGUISkin.box);

When I play the game in editor the box and text show up just fine. (It’s using the standard arial font and a GUIStyle that has the ‘text wrap’ box checked as well as a few other minor changes.) However, when I make a Windows build and run the executable, the BOX draws, but the text itself does not.

I don’t think it’s a font problem, since I use the default font everywhere in my program and the font shows up correctly in other parts of the GUI. It’s just this one box where the text is not drawing, and only running it outside the editor.

Any advice on what to do? I’m not even sure how to troubleshoot this one…

(Edit: FYI, running 3.X Pro)

Fixed it! For posterity, this had nothing to do with the GUI, and everything to do with the string I was putting into it.

Apparently in EDITOR, the following code worked:

		if (tutorialPrintText == "") tutorialPrintText = tutorialText;

However, this did not work at runtime. Instead, I had to amend the statement to the following:

		if ((tutorialPrintText == "") || (tutorialPrintText == null)) tutorialPrintText = tutorialText;

So there you go. Uninitialized strings are apparently equal to “” (empty string) in editor, but null in the runtime application. So you know.