Ask coding questions

← Back to all posts
Chat box
KadenGarner

Hi i need help coding a mini chat box for my multiplayer game if someone can help me please comment.

Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Voters
KadenGarner
Comments
hotnewtop
RYANTADIPARTHI
KadenGarner
RYANTADIPARTHI

@KadenGarner no problem.

19wintersp

You can open a WebSocket connection from each client to the server, and then whenever a message is sent on the WebSocket, broadcast it to every other client.

On the frontend, just create an element with an input box, and send/receive messages over the WebSocket connection.

KadenGarner