Chat in lobby

Hello,

I would like to add a chat in the lobby waiting room.
I have a chat already working “in game”, so once the players have loaded the game scene with the network manager, but it seems to be complicated to add a chat in a scene not loaded by the network manager?

What I have now:

  • the game starts, the player loads the first scene.
  • he connects either as host or client in a lobby.
  • I don’t know how to spawn my chat system on the network.

Is that possible, can I spawn a network object as soon as the player connects, or should I load a scene (additively maybe) to allow that?

Edit: Sure, I use Netcode, Lobbies and Relay.

Hello! Can you edit your post to indicate what networking solution you are using, please!

Thank you!

Done.

Any idea or solution?

Not sure if nobody knows, or if it is not possible with netcode, or if nobody cares :frowning:

I think you’ll need a separate solution from Netcode for GO to handle the chat, since you need it during the lobby phase as well. Unity mentions Vivox as an option in its documentation Vivox Unity SDK documentation.

I made my own solution via RPCs. The only thing you’d need is some kind of console. Mine was made with the quantum console asset

        [Command("c")]
        public void ChatMessage(params string[] message)
        {
            ChatMessageServerRpc(string.Join(" ", message), SessionManager.Instance.User.name);
        }

        [ServerRpc(RequireOwnership = false)]
        public void ChatMessageServerRpc(string message, string sender)
        {
            ChatMessageClientRpc(message, sender);
        }

        [ClientRpc]
        private void ChatMessageClientRpc(string message, string sender)
        {
            if (sender != SessionManager.Instance.User.name)
                Debug.Log($"[{sender}]: {message}");
        }