Page 1 of 1

Multiplayer Synced conversations

Posted: Fri Jun 07, 2024 1:51 am
by nathanj
Hi Tony,

I'm making a simple little multiplayer game and I would like to because to sync the dialogue UI/conversations over the network. I'm using PUN2 atm but will probably change if the game progresses. But for now PUN2 it is.

I would like it that if one player opens a conversation then that conversation is opened for all players in the room and if a response button is selected then that selection is passed over the network.

Starting the conversation is farily easy to do through an RPC but for syncing the response buttons, I'm not totally sure about that and was wondering if you had a suggestion.

Thank you,
Nathan

Re: Multiplayer Synced conversations

Posted: Fri Jun 07, 2024 8:19 am
by Tony Li
Hi Nathan,

Hook into the special script methods such as OnConversationStart, OnConversationLine(), and OnConversationResponseMenu():
  • OnConversationStart: Tell the other clients to pause and open the dialogue UI.
  • OnConversationLine: Pass the subtitle to the clients, and call the dialogue UI's ShowSubtitle method.
  • OnConversationResponseMenu: Pass the responses and show the response menu, but set the menu's Canvas Group > Interactable false so only the main conversation player can click it.
  • OnConversationEnd: Close the dialogue UI.