Skip to content

Chat system built on unity Netcode for GameObjects with command and voting support

License

Notifications You must be signed in to change notification settings

Edward-Khaymanov/Netcode-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netcode-chat

Chat system built on unity Netcode for GameObjects with command and voting support

Requirements

  • Textmeshpro
  • Netcode for GameObjects

Preview

Client1 Client2


Client2Cringe Client2Kick

Configure

In ChatHandler prefab you can see these options

ChatHandler

  • SystemMessageColor - when the system sends a message, the nickname is displayed in this color
  • OwnerMessageColor - when a user sends a message, his nickname is displayed in this color
  • ShowOnJoinMessage - should the system notify everyone about the user joining
  • ShowOnLeaveMessage - should the system notify everyone about the user leaving
  • OnJoinMessage - message after user nickname on join
  • OnOnLeaveMessage - message after user nickname on leave

Example

In Example folder you can see ExampleScene scene. To test, you have to build the project twice with different "IsHost" parameters.
Or use the ParrelSync extension and modify the Example script like this

Before:

private void Start()
{
    if (_isHost == false)
    {
        NetworkManager.Singleton.StartClient();
        return;
    }
    //...
    //...
    //...
}

After:

private void Start()
{
    if (ClonesManager.GetArgument() == "client")
        _isHost = false;
    else
        _isHost = true;
    
    if (_isHost == false)
    {
        NetworkManager.Singleton.StartClient();
        return;
    }
    //...
    //...
    //...
}