Photon Network instantiate problem when Master changes

JkcJkc
Hi,

I'm using PhotonNetwork with Unity v2018.3.10f1.

I've created a "waiting room" to wait for the players to join a room before starting the game.

It works perfectly, the player is instantiated on every player that is already in the room, but when the Master Client leaves the room and rejoins it, is not working anymore and the player is not instantiated on any of the Photon players.
The players that are still in the room are instantiated correctly on the new player scene.

Is it because the Master Client is lost? (Can't be because its reasigned to other player in the room)

How can I do to call the RPC method that instantiate the new player when the Master changes?

Code:

public void OnSceneFinishedLoading(Scene scene, LoadSceneMode mode)
{
if (PV == null)
{
PV = GetComponent();
}

if (PhotonNetwork.IsMasterClient)
{
Debug.Log("Creating lobbyPlayer");
PV.RPC("RPC_CreateLobbyPlayer", RpcTarget.AllBuffered);
}
}

[PunRPC]
private void RPC_CreateLobbyPlayer()
{
PhotonNetwork.Instantiate(lobbyPlayerPrefab, Vector3.zero, Quaternion.identity, 0);
}
Thanks!
Sign In or Register to comment.