Download

Line break for public text variable

Hello,
with “Shift + Enter” i can set a new line within a blueprint-text-variable. However, when i try this outside via the public variable (under the “Details”-Window of an actor) it is not possible. Is there a possibility to set a new line there too?

ue1.jpg

shift+enter might work

Nope unfortunately that will just work inside the blueprint, not on the details page.

Make variable a text type, make something like {nextline} everywhere where you want to have line break, in the function which read the variable (constructed script mb?), read the presetup value pass it thru “format text”, add the parameter “nextline” into the details of format text and connect literal value to input which would be created for this “nextline” parameter, make the input shift+enter, not literal, just press shift+enter, which would make it contain only linebreak.

Try the following

First do a shift enter in a blueprint then select all using ctrl+A copy and paste it into your property box

@Commander Shepard: I tried your suggestion. It did not work, because the new-line was ignored after copy and pasting it.

@CriErr: Your solution worked (screenshot attached).

Thank you both for your help.

a46284d0b7f703f7b56a4d679115012b8041ef5e.jpeg

if you want to be able to setup variables on spawn, you can mark them as “expose on spawn”.

In addition to this: Marking as “Editable” AND “Exposed on Spawn” will make variable appear in the Create Widget node. They will
be additional inputs and you don’t have to use the return and set the variable in and extra step. Saves room and looks nicer.

Very nice tip with “Expose on spawn”. Thank you!