title: Unity3D ScrollView/ScrollBar from bottom to top
body: <p>I'm trying to create a terminal emulator in Unity. I'm able to enter text and have it displayed as output above, and the output will generate a scrollbar when enough text is entered via a ScrollView.</p>
  
  <p>However I can't figure out how to make the scrollbar jump to the bottom when a user enters text.</p>
  
  <p>This is the method used to draw the GUI Window.</p>
  
  <pre><code>// relevant instance variables
      private Rect _windowPosition = new Rect();
              List&lt;string&gt; output = new List&lt;string&gt;();
              string user_input = "";
              Vector2 scroll_pos = new Vector2(1,1);
  
          ...
          ...
          ...
  
      private void onWindow(int windowID){
                  GUILayout.BeginVertical();
  
              // Output is placed here. Is Scrollable
                  scroll_pos = GUILayout.BeginScrollView( scroll_pos );
                  GUILayout.Label( String.Join("\n", output.ToArray()) );
                  GUILayout.EndScrollView();
              // Output ends here. Next piece is user input
  
                  user_input = GUILayout.TextField(user_input);
                  if (Event.current.Equals(Event.KeyboardEvent("return"))) {
                      output.Add(user_input);
                      user_input = ""; //clears the TextField
                      scroll_pos.x = 1;
                      scroll_pos.y = 1;
                  }
                  GUILayout.EndVertical();
                  GUI.DragWindow();
              }
  </code></pre>
  
  <p>From my searching, I'd seen it said that I should just change the scroll_pos variable, since that's used to control/read the scrollbar's position. The scrollbar's value is normalized between 0 - 1.</p>
  
  <p>I've tried forcing the scroll_pos values to be both, 0 and 1, but it has no impact. Beyond this I'm not sure how to approach the problem.</p>