Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Bolt Multi-line String Fields?

Discussion in 'Visual Scripting' started by ModLunar, Sep 27, 2020.

  1. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    260
    I made a custom Unit (node) with the following code, and clicking Tools > Bolt > Build Unit Options in the menu in Unity:

    Code (CSharp):
    1. using UnityEngine;
    2. using Ludiq;
    3. using Bolt;
    4.  
    5. public class DialogueLineUnit : Unit {
    6.     [DoNotSerialize] private ValueInput characterId;
    7.     [TextArea]
    8.     [DoNotSerialize] private ValueInput line;
    9.     [DoNotSerialize] private ValueOutput next;
    10.  
    11.     protected override void Definition() {
    12.         characterId = ValueInput<int>(nameof(characterId), 0);
    13.         line = ValueInput<string>(nameof(line), "Hi there!");
    14.         next = ValueOutput<DialogueUnit>(nameof(next), null);
    15.     }
    16. }
    17.  
    My line of dialogue looks like this:
    upload_2020-9-26_22-4-17.png

    This is hard to make dialogue, because the text is in 1 line.
    Not only that, I sometimes want line breaks in my dialogue lines.


    Using the usual [TextArea] attribute has no effect.

    How do I make this a multi-line text area?
     
    Last edited: Sep 27, 2020
    Createman likes this.
  2. Createman

    Createman

    Joined:
    Apr 14, 2013
    Posts:
    14
    Has anyone been able to make a multi-line text area for Bolt?
     
unityunity