I’m not sure where to start with this aspect of the game but I have one in which two players should be able to converse with other using text in the game. For example, if I typed the message “hello” in my text box. That very same string of text will in my talk Bubble and the same for the other player. Each player would also be able to copy and paste text from a database to their text window to have it appear in their talk bubble. I see a lot out there to use when a player is speaking to an NPC in a game but not when the players are conversing with each other. Any guidance would be useful.
Assuming you have the Player Object itself handling the communication and the visuals, you could do something like:
[SyncVar(hook="MessageSyncCallback")]
string _message;
// Called by the UI that the player types their message into
public void SetNewMessage(string msg)
{
CmdSetNewMessage(string msg);
}
[Command]
void CmdSetNewMessage(string msg)
{
_message(msg);
}
void MessageSyncCallback(string newMsg)
{
_message = newMsg;
UpdateMyVisualMessage(_message); // Updates the UI on the player
}
Good Luck!