AutoSyncLevel not working, only MC loads level

Options
Hi there,

I currently have one main issue, and one minor issue.

First one is that calling PhotonNetwork.LoadLevel on Master Client is only working for the master. Everything with networking is working fine, the lobby, room creation, 2 players in level. But this piece of code is not loading level for both players:

PhotonNetwork.LoadLevel(1);

While debugging, I doublechecked:
?PhotonNetwork.AutomaticallySyncScene
true
?PhotonNetwork.IsMasterClient
true

What am I missing here??

Second less important is that I want to change Master Client when some wants to change level. So that every player can initiate this. This is also not working as expected and is not moving the Master Client:

public void ChangeScene(GameObject sender)
{
Player[] players = PhotonNetwork.PlayerList;
foreach (Player player in players)
{
if (player.IsLocal)
{
PhotonNetwork.SetMasterClient(player);
}
}

if (sender.name.Equals("VoxelScene"))
{
PhotonNetwork.LoadLevel(1);
}
else if (sender.name.Equals("FutureScene"))
{
PhotonNetwork.LoadLevel(2);
}

}

Thanks in advance for any suggestions!!

Comments

  • jeanfabre
    Options
    Hi,

    Can you check of the basic tutorial works? it uses sync level loading, make sure you check how it's done, you may miss something like you haven't explicitly turned on level loading sync, or something.

    Bye,

    Jean
  • Bender
    Options

    Ok, thanks. I'll try that.

    Regarding changing Master Client, could you tell me if this should work like this?

  • jeanfabre
    Options
    Hi,

    you don't need to change the masterclient for a given player to change levels, simply send an rpc like "LoadSomeScene" to the master ( who ever it is, it never matters), and the master will execute that.

    Bye,

    Jean
  • Bender
    Options
    Hi Jean,

    Thanks for your help! The issue was somewhere in destroying and initiating player object when changing scenes. DontDestroy did the trick.

    And thanks for the RPC tip. Indeed more elegant.

    Cheers