PhotonNetwork.automaticallySyncScene Bug

Options
Hi,

I am using PUN 1.83.

There seems to be a bug with PhotonNetwork.automaticallySyncScene (when it is set to true).

From the docs, ONLY PhotonNetwork.LoadlEvel should cause the scenes to sync between players:

"Defines if all clients in a room should load the same level as the Master Client (if that used PhotonNetwork.Load -
Level)."

When I use SceneManager.LoadScene instead on the master client, it still causes the scenes to be synced across all players, this is unexpected behaviour.

This seems like incorrect behaviour and is preventing me from implementing certain features in my game.

I would like to avoid having to turn off PhotonNetwork.automaticallySyncScene as it is a useful feature most of the time.

Cheers,

Niall

Comments

  • [Deleted User]
    Options
    Hi @nindim,

    sorry for the late response and thank you for letting us know.

    We are discussing about this and investigate on how to avoid this behaviour. For now maybe I can help with a quick workaround which might already solve the problem for you. Open the PhotonHandler script from the PUN package. You can find it in Assets\Photon Unity Networking\Plugins\PhotonNetwork directory. Now remove SetLevelInPropsIfSynced(...) call(s). Based on your used Unity version this is either in Start() (line 71) or in OnLevelWasLoaded(...) function (line 81). This makes sure that you don't synchronize the current scene when using SceneManager.LoadScene(...).

    Please let us know, if that works for you without problems since while testing this I came up with some problems occurring.
  • nindim
    Options
    Hi,

    Thanks for getting back to me.

    I ended up rolling my own system to load levels with bespoke behaviour for when the message queue gets disabled/enabled, so unfortunately I can't test that workaround in my project.

    Cheers anyway!

    Niall