Chat: new messages, bottom of scrollview?

Hello,

I’ve followed the multiplayer tutorials from GTGD, and I want to change the chat. In some multiplayer games, the new message from other players come under the old messages. But in that tutorial the new messages will come above it (I hope you understand what I mean xD).

Is there mayby an solution so I can calculate the minimum of the scrollPosition, and set the scrollPosition (Y) to that value? I don’t know what part of the script you need (it is big…), but a example with the solution is also good.

scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(windowWidth - padding), GUILayout.Height(windowHeight - padding - 5));

GUILayout.Label(communication, myStyle);

GUILayout.EndScrollView();

Thanks, Jomaikke

I know it’s an old question but I just went through the GTGD tutorial too and wanted more out of the chat so if anyone else lands here, you will know.

For what you want (newest messages being at the bottom of the chat), in the CommunicationWindow script, you need to change the RPC SendMessageToEveryone from

communication = pName + " : " + message + "

" + "
" + communication;

to

communication = communication + pName + " : " + message + "

";

I removed one "
" because there is no need for it and a waste of space imo.

Are you using photons PUN?

I have the same question xD

tinkering with some things while i wait for a reply

In fact, here’s my thread: