


I want the masterclient to load the "nesne" when the number of players in the game is equal to x. I still can't succeed because if the last sitting player is not the masterclient, the owner of the "nesne" still cannot become the masterclient.
#Last man sitting unity 3d code#
Code file I use: public class control : MonoBehaviourPunCallbacks And masterclient can destroy the object at will. So the owner of the object becomes the masterclient in the game. What I want is this: Even if the masterclient is the first player to take the seat, it waits for the other players to take the seat, and when the x value equals the number of players in the game (when the last player is seated), the masterclient loads the item. Only the last player in the seat can destroy it because the owner of the object is himself. In part of the game I have to completely destroy this object. Because when the last player sits on the seat, the value of x becomes equal to the number of players in the game. The last person sitting on the seat uploads this object to the stage. When all the players in the game are seated (when the number of players in the game is equal to x) I load a photon object into the scene. I send this value to all players with the help of rpc.

When you get up from the seat, the x value decreases by 1. The x value increases by 1 each time the player sits in the chair. Example scenario : there are 4 seats on the stage, and I have an int value named x.
