I cannot believe how simple this may sound, but how impossible it seems to be.
I have a simple text object on my GUI. Now and then I want it to display a message, such as “You were hit by a big bad goblin”. But I would like it to create a new line after whatever might already be there. So i’ve created this very simple line of code:
status.text = status.text + “You were hit by a big bad goblin”;
Unfortunately, it just wraps around the limits of the text box, and I wont get a new line with each new message. I’ve tried the /n and //n and /r/n escapes, I’ve even tried the Environment.newLine thing, which seems to be deprecated.
Surely Unity has a means of creating a newline from a simple string, I just have no idea what it is.
Can anyone help me out?
(C# please, if applicable)
google not your friend? ;) try "\n"
– gjfFound an answer to this (I'm surprised this hasn't been well documented). [Here is the post][1] [1]: http://answers.unity3d.com/answers/155419/view.html
– losingisfun