# Add a new line inside a Text var

**URL:** <https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990>\
**Category:** UI\
**Tags:** variables, text, unreal-engine, Blueprint, question, UMG\
**Created:** [April 14, 2015, 9:30am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990 "2015-04-14T09:30:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flakky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flakky/32/918696_2.png) [@Flakky](https://forums.unrealengine.com/u/Flakky)\
**Post date:** [April 14, 2015, 9:30am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/1 "2015-04-14T09:30:36Z")

</div>

Hello guys!

I ran into a problem with setting text inside UMG.

As you may know, you can add ne line by pressing Shift + Enter inside text block. Like this:

 ![38657-2015-04-14+12-17-10+notewidget.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/8/f38d63d9d07d648f9659bda3070406759a53b26f.png)

But the problem is that I have custom event, that sets my text from a variable and I have no Idea how to add new line, because Shift + Enter does no effect on my text.

Soo… How do I add a new line in text variable in order to set Widget Text??

---

<div class="post-metadata">

**Author:** ![alperenakyuz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@alperenakyuz](https://forums.unrealengine.com/u/alperenakyuz)\
**Post date:** [April 14, 2015, 12:41pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/2 "2015-04-14T12:41:38Z")

</div>

It’s usually \n in C++ but I’m not sure if it would work here.

---

<div class="post-metadata">

**Author:** ![krides](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@krides](https://forums.unrealengine.com/u/krides)\
**Post date:** [May 16, 2015, 10:24pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/3 "2015-05-16T22:24:44Z")

</div>

In 4.8, **Shift+Enter** adds line breaks to nodes.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_199281e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_199281e7](https://forums.unrealengine.com/u/anonymous_user_199281e7)\
**Post date:** [May 17, 2015, 4:54am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/4 "2015-05-17T04:54:18Z")

</div>

This is a workaround for now I’ve got this guy in a separate BPMacro library (encase of catistrofic death down the road but it works for now.

> **[Blueprint: DrawText, Append, newline(\\n)](https://forums.unrealengine.com/questions/78437/blueprint-drawtext-append-string.html)**
>
> Regarding this: I’m not sure if newlines previously worked or whether he is referring to C++ and not Blueprint. Is it (will it be) possible to append a newline to a string for multi-line textual display using DrawText? Adding \\n or even \< b r...

---

<div class="post-metadata">

**Author:** ![Flakky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flakky/32/918696_2.png) [@Flakky](https://forums.unrealengine.com/u/Flakky)\
**Post date:** [May 17, 2015, 2:05pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/5 "2015-05-17T14:05:17Z")

</div>

But I don’t need it for String. I need it for Text variable…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_199281e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_199281e7](https://forums.unrealengine.com/u/anonymous_user_199281e7)\
**Post date:** [May 17, 2015, 8:41pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/6 "2015-05-17T20:41:00Z")

</div>

snap missed that it was late 😛 idk if that will apply to a text variable but it is convertible just drag a pin on and on to a text pin it will convert. I’ve got them on multiline text boxes witch run off of text rather than strings.

---

<div class="post-metadata">

**Author:** ![krides](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@krides](https://forums.unrealengine.com/u/krides)\
**Post date:** [May 17, 2015, 8:42pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/7 "2015-05-17T20:42:52Z")

</div>

This no longer works in 4.8, by the way.

---

<div class="post-metadata">

**Author:** ![Flakky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flakky/32/918696_2.png) [@Flakky](https://forums.unrealengine.com/u/Flakky)\
**Post date:** [May 17, 2015, 8:46pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/8 "2015-05-17T20:46:15Z")

</div>

Lol… They ruined last hope in making multi-line text 😃

---

<div class="post-metadata">

**Author:** ![krides](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@krides](https://forums.unrealengine.com/u/krides)\
**Post date:** [May 17, 2015, 8:47pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/9 "2015-05-17T20:47:54Z")

</div>

Like I said earlier, you can just do **Shift + Enter** for line break 🙂

---

<div class="post-metadata">

**Author:** ![Flakky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flakky/32/918696_2.png) [@Flakky](https://forums.unrealengine.com/u/Flakky)\
**Post date:** [May 17, 2015, 10:15pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/10 "2015-05-17T22:15:39Z")

</div>

Like I said in the first post, I need to make newline in a variable… And 4.8 is not the answer.

Because text in widget sets from variable, which I set on exact instance of the object with Construction Script. So I want to select my note in viewport and type the text I need in Details panel. But I cannot make newline there…

---

<div class="post-metadata">

**Author:** ![krides](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@krides](https://forums.unrealengine.com/u/krides)\
**Post date:** [May 17, 2015, 11:04pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/11 "2015-05-17T23:04:13Z")

</div>

It is indeed impossible to add line breaks to a variable. However, there are multiple ways of doing that via scripting. In simple cases (which, I agree, is not your case), the following is possible:

 ![43110-screen+shot+2015-05-18+at+0.34.32+copy.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/e/1/3e1ee3195a363122ef54e91d05ef24ac89a60b34.png)

In your case, you can use the Format Text node, like this. Drag a line out of a variable of type Text, and type “Format Text.” This node will let you insert line breaks wherever you want like in the example below.

 ![43105-screen+shot+2015-05-18+at+0.59.26.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/6/bb6662e6f4bbbc17e39fb060eb3e21ffd01db3fb.png)

To rename the pin, select the Format Text node and go to Details.

![43107-screen+shot+2015-05-18+at+0.59.47.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/5/7c58bc516376aa48a0e2bc280a54820b1356556d.png)

I hope this helps.

---

<div class="post-metadata">

**Author:** ![Flakky](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flakky/32/918696_2.png) [@Flakky](https://forums.unrealengine.com/u/Flakky)\
**Post date:** [May 17, 2015, 11:24pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/12 "2015-05-17T23:24:37Z")

</div>

Hmm, The way with format text should work fine. Thank you!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_199281e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_199281e7](https://forums.unrealengine.com/u/anonymous_user_199281e7)\
**Post date:** [May 18, 2015, 5:18am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/13 "2015-05-18T05:18:26Z")

</div>

O.o thats some good magic thank you for that, will be changing my code now. Make sure this is marked answered if it works for yea. 🙂

---

<div class="post-metadata">

**Author:** ![InterSlayer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@InterSlayer](https://forums.unrealengine.com/u/InterSlayer)\
**Post date:** [June 10, 2015, 12:03am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/14 "2015-06-10T00:03:50Z")

</div>

Make a multiline textbox in UMG, use shift+enter to add a single new line.

On HUD construction, get the text from the multiline text box and save it to a variable (string or text).

Now you can use that to append newlines.

---

<div class="post-metadata">

**Author:** ![Kmack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kmack/32/706181_2.png) [@Kmack](https://forums.unrealengine.com/u/Kmack)\
**Post date:** [December 15, 2015, 3:05am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/15 "2015-12-15T03:05:28Z")

</div>

Ingenious trick. Thanks for this!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b3639a6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b3639a6](https://forums.unrealengine.com/u/anonymous_user_4b3639a6)\
**Post date:** [April 5, 2016, 3:35pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/16 "2016-04-05T15:35:18Z")

</div>

Hey  
When you are in Editor you can just use  
to make a newline.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b3639a6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b3639a6](https://forums.unrealengine.com/u/anonymous_user_4b3639a6)\
**Post date:** [April 5, 2016, 3:35pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/17 "2016-04-05T15:35:59Z")

</div>

Hey you can just use  
to seperate lines.  
At least in the Standard Editor

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_4b3639a6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_4b3639a6](https://forums.unrealengine.com/u/anonymous_user_4b3639a6)\
**Post date:** [April 12, 2016, 10:33am UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/18 "2016-04-12T10:33:37Z")

</div>

Lol sry I didnt see that html code works in this text block xD

You have to use \< br \> without space ^^

---

<div class="post-metadata">

**Author:** ![MickD777](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MickD777](https://forums.unrealengine.com/u/MickD777)\
**Post date:** [August 30, 2016, 6:07pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/19 "2016-08-30T18:07:28Z")

</div>

You can add a meta "MultiLine " to do that:

```
UPROPERTY(EditInstanceOnly, meta = (MultiLine = true))
FText ItemDescription;
```

---

<div class="post-metadata">

**Author:** ![jeevcat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jeevcat](https://forums.unrealengine.com/u/jeevcat)\
**Post date:** [November 25, 2016, 6:19pm UTC](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990/20 "2016-11-25T18:19:36Z")

</div>

This is exactly what I was looking for. Thanks!  
How do you find these undocumented UPROPERTY specifiers (especially those mysterious meta ones)? Where can I look in the source?

[Next page](https://forums.unrealengine.com/t/add-a-new-line-inside-a-text-var/314990.md?page=2)
