Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

AutoSyncLevel not working, only MC loads level

$
0
0
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!!

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>