Make GUI.BeginScrollView scroll when text not fit on screen?

hey guys,
trying to figure this one out. been searching maybe i just dont understand how this works.
but im trying to make a dialog / chat log / battle log area. each new action adds another line to a string. once the chat box gets full though how do i make it autoscroll to the bottom of the text?

here is a picture of what it looks like,
pic

this is the code i have right now.

scrollPosition = GUI.BeginScrollView (new Rect (422, 22, 785,275), scrollPosition, new Rect (0,0, 200, 1000));

You need to change scrollPosition.y every time you add an entry to the log.

By having the following line of code every time you add an entry to the log, the scroll view will be scrolled down:

scrollPosition.y = float.MaxValue;

Setting it to 0 will scroll it to the top.

So, I will write you a simple example with comments from which everything will be clear(write on CSharp):

private Vector2 scrollPos = Vector2.zero; //pos in our scroll
private string tempStr = ""; // our text info, which we see into scroll

void Start() {
 //initialization our text variable, add into new line
 for(int i = 0; i < 20; i++) {
  if (tempStr! = "") {
   tempStr = tempStr + "

"; //add new line
}
tempStr = tempStr + “some text”; //add text in our variable
}

 void Update() {
  //If you want see scroll always bottom, that change manualy scrollPos.y
  if (Input.GetKeyDown(KeyCode.Space)) { //tap to "space" in keyboard
   scrollPos.y = 100000f; // very big value or try float.maxValue
  }
 }

 void OnGUI() {
  //Making scroll, first parametr - rectangle - dimension on screen
  //second - position into scroll, 3 - dimension our scroll.
  //So, dimension on screen and position is know, but dimension our scroll is unknow
  float texth = GUI.skin.label.CalcHeigth(new GUIContent(tempStr), 300);
  //In function Calcheigth we find heigth our text if width = 300
  //But remember, if you want text fill our scroll, that width = Widthscroll - Sizescrolltexture
  //Create our scroll
  scrollPos = GUI.BeginScrollView(new Rect(10, 10, 300, 200), scrollPos, new Rect(0, 0, 300, texth));
  GUI.Label(new Rect(0, 0, 300, texth), tempStr);
  GUI.EndScrollView(); //close our scroll
 }