- Home /
Changing UI for network chat
I want to create a chat application using Unity, and I want it in such a that the local client will have a different colored text msg and maybe in other position also. I have two questions, 1.) How do I identify the local client; and
2.) How do I create a UI where I can create a scrollable list and elements can be added to it dynamically but relative to the client they are being called from i.e. positioning or changing the color according to the client. (Hope I am able to explain correctly, basically, I want to create a WhatsApp like chat app)
Thank you in advance. :)
Answer by hexagonius · Jul 19, 2017 at 09:14 PM
Use this https://docs.unity3d.com/ScriptReference/Network-isClient.html
Create two UI elements stretching in width and with a text component left and right aligned. Depending on client, instantiate the relevant one and set the text.