Bug in GUIText with multiple lines?

I find this inconsistency really annoying …

private var GUIStr : String = "1st Line \n...2nd Line";
	
	function Start () {

	guiText.text=GUIStr;
	
	}

now, if I change GUIStr to a public var instead, the string in the inspector only shows “1st Line”, yet still prints

1st Line
…2nd Line

Changing GUIStr in the inspector to “1st Line \n…2nd Line” Then prints

1st Line\n…2nd Line
…2nd Line

Why can’t you assign multiple lines to a GUItext in the inspector?

I wanted a handy script where you can set a GUItext by typing in multiple lines into the inspector, but it seems its not possible - it has to be hard coded?

You can, just use option-return. Typing “\n” in the inspector is literally the characters "" and “n”, that’s not a return character. Apparently alt-return doesn’t always work on Windows, in which case you can copy-paste from somewhere else.

–Eric

Thanks Eric :slight_smile: