Master client switch
Options
Hi,
In case the master-client disconnects and someone else becomes the new master-client, how can he get reference variables to the transferred scene-objects?
In case the master-client disconnects and someone else becomes the new master-client, how can he get reference variables to the transferred scene-objects?
0
Comments
-
That client will already know the scene objects (every client does). The new master client is automatically owner and can send updates.
There is no list of game objects that switched control recently, sorry. I think you can go through all PhotonViews and check if they are scene objects.0 -
Hi Tobias,
So let's say "I" become the new master-client. How can I send updates (eg. change its position) without a reference variable?
And if there's no other way, how can I get a list of all the PhotonViews?0 -
If a PhotonView observes a script, PUN will call OnPhotonSerializeView() automatically. You don't have to know which ones are yours - PUN does know.
If you don't use that, then you could ask Unity for a list of PhotonViews and check each.0