[BUG] Destroyed Scene Objects come back after rejoin

Options
Photon PUN 2 (4.1.2.14)
Unity 2018.3.12f1

Repro steps
  • 2 Players transition from Scene1 to Scene2 (Automatically sync scene)
  • Master client spawns various scene objects
  • Both players transition from Scene2 to Scene1 where everything is as expected
  • Non-Master rejoins the same room and all the objects spawned in Scene2 are visible in Scene1

Comments

  • Spektre
    Options
    Should your third repro step read "Both players transition from Scene2 to Scene1 where everything is as expected"?
  • Xefier
    Xefier
    edited May 2019
    Options
    Oops yes, fixed.
  • Spektre
    Options
    Known Issues
    When you load a new scene, all instantiated GameObjects are destroyed only locally but not on the server. Anyone who joins the room later on still creates those GOs. To work around this, PhotonNetwork.Destroy your instantiated game objects before loading a new scene. Or use: PhotonNetwork.RemoveAllInstantiatedObjects(player).

    https://forum.unity.com/threads/photon-unity-networking.101734/
  • Xefier
    Xefier
    edited May 2019
    Options
    What about PhotonNetwork.DestroyAll?
    Or does that break scene syncing.
  • Spektre
    Spektre
    edited May 2019
    Options
    Sorry...above my pay grade.

    I don't know. I had just remembered reading about this,
  • Xefier
    Xefier
    edited May 2019
    Options
    Tested and seems to work fine.
    Thank you for the help.

    I hope they release an official fix soon though.