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();
}