Can I Include Line Breaks or Horizontal Tab in Variable-Generated Text?

Discover the Method for Adding Line Breaks and Horizontal Tabs to Variable-Based Text

Aryel
Written by AryelLast update 4 months ago

You can effortlessly include line breaks and horizontal tabs in text filled with variable content. No coding expertise required ā€“ you just need to utilize the appropriate characters, known as 'escape sequences.' Here's the list of accepted ones:

  • \n (for a line break)

  • \t (for a horizontal tab)

Using '\n' will introduce a line break, causing subsequent text to appear on a new line. Employing '\t' functions as a horizontal tab, indenting the following text.

For instance, let's say you want to generate text similar to the image below:

Start by adding a text asset to your scene and populate the content field with the variable name you wish to use for filling the text box ā€“ represented by {t} in our example.
Then, create your variable by accessing the 'Variables' settings.

Define the name and type ({t} - Text), and fill out the 'Starting Value' with your desired text, incorporating escape sequences as needed:

My placeholder text\nwritten on two lines\n\tā€¢ with bullet list\n\tā€¢ this is my second bullet

Remember, you can also employ these escape sequences in the 'Set/Edit variable' results of interaction.

See sample campaign here.

Did this answer your question?