Is it possible to request a line break inside the Inspector?

I have a tooltip system and to avoid text spilling off the side of its backdrop, I need to occasionally insert line breaks. Since each object that has a tooltip has a tooltip script attached, it also has a public string where I can change what that tooltip is.

I’m using a stylistic 3D interface, so I’m using 3D text; thus there is no automatic word wrap or anything of the sort.

I tried inserting the standard
for a line break but it appears that this doesn’t work for text entered in the inspector. Does this mean I’m going to have to write an entire script just to implement line breaks? Seems a bit convoluted, so I figured I’d ask around for alternatives.

Type alt/option-return.

I found a good solution at this thread:

Add the TextAreaAttribute to your string variable, and the Inspector will now provide you with a larger text entry box that allows you to just use the Enter key to make carriage returns. Yay!

eg:

[TextArea]

public string myString;

Guess I’ll just answer my own question since I figured out a workaround. Not a very convenient one, though. Looks like you have to type your line breaks out in Notepad and copy/paste them into the inspector. Only way to get it to work.

Hopefully the Unity team looks into this.

You can also use an escape sequence in the Inspector and replace it in your script.

We use three under-scores to represent a newline.

When you display the string to the screen you use this:

`Debug.Log(someString.Replace("___", "\n"));
`

Sorry this came a little late...

Simple. On the Mac it’s Option-Shift-Return.

In version 2.14.0.

In the Inspector, first make sure the “LEADING” attribute in the TEXT AREA(SCRIPT)> PARAGRAPH> LEADING is set to “1.” Then, in the TEXT AREA(SCRIPT)> PLAIN TEXT, type your string out and press “Enter” anywhere you want a line break.

I don’t want to take credit for the answer above. A gentleman by the name of Ben O found this answer.

If your string is getting cut off, in the inspector > Text Area(Script) > Container > editing the Content Height or Content Width will give you more room to display your string.