Scroll Bar

I have a chat window and i want it to display the last messages from the players at the bottom of the conversation. The problem is that i have managed to do that but window won’t go automatically to the bottom of the conversation unless i scroll it there otherwise it remains at the top of the conversation. Does anyone know how I can make it do that automatically?Than you. This is the code that i use for the chat windows

function ChatWindow(id : int)
{
    var s : String="";
    var ms : message;
    GUILayout.BeginVertical();
    _chatScrollVector2 = GUILayout.BeginScrollView(_chatScrollVector2, InvisibleStyle, InvisibleStyle);

    for(i=0;i<= allText.length-1;i++ )
    {
        ms = allText*;*

newskin.customStyles[2].normal.textColor = ms.messageColor;
s = ms.getAllText();
var dbgstr : UnityEngine.Color = newskin.customStyles[2].normal.textColor;
GUILayout.Label(“”+s, newskin.customStyles[2]);
}
*GUILayout.EndScrollView(); *
GUILayout.EndVertical();
}

You can set _chatScrollVector2.y to Mathf.Inifity, the Scrollview will clamp it to max.

Note that drawing all the lines of your text with Label is going to be a problem after a undred lines or a thousand, let alone more. Take a look at my question on that subject.

thank you very it worked