|
I am making some localized tips to be displayed when my player enters an area. These tips are displayed over the characters head. I have a gameObject with an exposed string, so that I can place tips around my scene, and enter the message I want to have displayed. The string is then passed forward to a TextMesh when the character collides with the tip. The problem I am encountering is entering new line ( \n ) into the string in the inspector. The escape character is shown in inspector but is left out in game ( the '\' is gone, but not the 'n'). I have tried entering \n by using alt + enter ( as suggested in the reference manual ). But it doesn't seem to work. Has anyone managed to input newlines through the inspector? (how the hell did you do that :o?)
(comments are locked)
|
|
This appears to be a bug in the windows version of Unity. You can't manually type a return character into an inspector text field, and \n doesn't work. The only workaround for this is to copy and paste a return character (for example, from notepad). Thanks, that will do fine!
May 10 '10 at 08:20 AM
ZanzibarDreams
I attempted to type in a Ctrl-J... and poof went the Editor... lol Do not do that! (3.1) Why did they not resolve that with version 3 ?!? Cut & Pasting text from Notepad seems to work, but painful to format to fit the scene.
Dec 06 '10 at 10:27 AM
dingben
That worked a treat. Thanks for that. Just to clarify for others, there isnt any phisical character that appears in the inspector. . . simply copy and paste text (including blank lines) from a text field.
Oct 04 '11 at 03:16 AM
Fehr
(comments are locked)
|
|
You can also create a custom inspector that uses a TextArea, rather than a TextField, for the string in question. I am on a tight deadline, but I'll look in to this more! thanks
May 10 '10 at 08:21 AM
ZanzibarDreams
(comments are locked)
|
|
Picked up Molix idea :
(comments are locked)
|
|
Not sure if this question is still alive, but I found another workaround to put a newline into a string in the inspector: Just place NEWLINE in your string, or replace the NEWLINE in the script with something else.
(comments are locked)
|
