PUN2 - Change Master Client on Disconnect
Hello everyone,
I am new in Game Development and completely new in Multiplayer Networking. I am creating a Racing game and somehow I succeed to implement online multiplayer on my game using PUN2 and I am using Unity 2019.4.6f1. Everything is working fine except one thing. When Master Client is leaving the game, everyone disconnecting instantly. I searched everywhere but didn't find any solution. How to switch Master Client on disconnect and continue my game normally?
Thanks.
I am new in Game Development and completely new in Multiplayer Networking. I am creating a Racing game and somehow I succeed to implement online multiplayer on my game using PUN2 and I am using Unity 2019.4.6f1. Everything is working fine except one thing. When Master Client is leaving the game, everyone disconnecting instantly. I searched everywhere but didn't find any solution. How to switch Master Client on disconnect and continue my game normally?
Thanks.
0
Best Answer
-
Hey @Only4Gamers, When a Master Client leaves and there is at least another actor joined, a new Master Client is chosen by the server, so OnMasterClientSwitched is triggered on other joined actors if any.5
Answers
-
Hey @Only4Gamers, When a Master Client leaves and there is at least another actor joined, a new Master Client is chosen by the server, so OnMasterClientSwitched is triggered on other joined actors if any.5
-
Hi @Only4Gamers, @Paras,
Thank you for choosing Photon!
@Paras' answered already but I wanted to add a link to the documentation page.0