- Home /
How can I create a simple chat system for my multiplayer game?
I have created a small multiplayer game. I would like to know how to add a chat system to the game. Basically, I need a small textbox that allows the player to type his or her message, and a larger box that displays all of the messages. For now (since I don't have an online database for players to actually create an account), players would just enter their name each time the game starts, and that would be the name that is displayed in the chat.
I would think there would be a simple way to do this. All I need is some textareas, a large box for displaying the messages, and a method for updating the chat box to ALL players when a new message is added to the list.
I am trying to avoid all of the 30-60 minute tutorials out there, because they are all specific for their games, and I don't think it's really that complicated. (For example, other developers have created different scripts that are referenced in the chat script, so unless I've been following along with ALL of their tutorials, I will not have the correct scripts.)
You will need to use RPC to send messages. When user press enter you send stirng to everyone in that room. And then you display it.
Answer by Firedan1176 · Apr 15, 2014 at 11:43 PM
quill18creates on youtube does an excellent job explaining multiplayer with Photon Networking. If you happen to be using Photon, you can follow his tutorial on using RPCs with his multiplayer series. You can then use that knowledge to create a chat system. The tedious job is actually handling the type box and possibly using a scroll wheel to see previous messages. Good luck!
Your answer
Follow this Question
Related Questions
Testing my multiplayer character offline 0 Answers
Unity networking tutorial? 6 Answers
Photon variable synchronization 1 Answer
My network server doesn't work. 0 Answers
Multiplayer Game Disconnects 1 Answer