Search Unity

Unity UI Show text after each iteration while keeping the previous text from the previous iteration

Discussion in 'UGUI & TextMesh Pro' started by WaitLightning, Mar 10, 2019.

  1. WaitLightning

    WaitLightning

    Joined:
    Nov 11, 2018
    Posts:
    2
    So I am having trouble with text output. I cannot figure out how to keep the text from the previous while loop iteration so that instead of overriding the text box the next text output for the next iteration just moves to a new line. This is the code
    2019-03-09.png This is what actually happens. 2019-03-09 (1).png But I want this to happen instead. 2019-03-09 (3).png
     
  2. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    outputtext += ?
     
  3. WaitLightning

    WaitLightning

    Joined:
    Nov 11, 2018
    Posts:
    2
    Yea I figured it out. Completely forgot that in order to append text you need to use a += operator I kept using = and I realized that the text kept getting overridden but I could not find anywhere on what operator to use to not override the previous value.