Search Unity

TextMesh Pro Scroll A Text Once It Reaches The End Of The Viewport

Discussion in 'UGUI & TextMesh Pro' started by DarkSlash, Apr 12, 2019.

  1. DarkSlash

    DarkSlash

    Joined:
    Sep 30, 2011
    Posts:
    128
    I want to make a dialog system that automatically scrolls down when the text is larger than the background image.

    I created a ScrollView, inside has a ViewPort, and I changed the content for a TextMeshPro. I deleted ScrollBars as I don't need it. I set only de VERTICAL movement in the Scroll Rect, and in the TextMeshPro object I added a Content Size Fitter and set it Vertical Fit as Preffered Size.

    I pass a string to the TextMeshPro object, and thanks to a script I attached, the string is shown character by character, like someone's typing on a keyboard. So the complete string is not shown at once but being build every X seconds.

    The behavior I want is that, when the string reaches the lower part of the image (viewport) start scrolling up automatically. But this doesn't happens. What it happens is when the first line is completed, it scrolls up and the second lines starts to be written.

    Here's a video of the result I have. What am I missing?

    YKmD4.gif
     
    Farmaduke likes this.
  2. NestorVG

    NestorVG

    Joined:
    Feb 12, 2019
    Posts:
    35
    Sorry if this is necroposting or something, but did you manage to make it?