Persistent Players Across SceneLoad

I was using Photon's auto cleanup on SceneChange whenever I SceneLoad. However, the player prefab get's destroyed whenever I change scenes. I think because I spawn it and it has a photonView on it. Is it possible SceneLoad without having specific player objects get deleted?

Are there any sideeffects to autoCleanUpPlayerObjects to false in Photon and the rooms? I just want the objects to delete themselves based on Unity's DontDestroyOnLoad.

Does Photon have an AdditiveSceneLoad option? AdditiveScenLoading didn't appear to mix well with photonView IDs colliding.

Answers

  • are u using the static keyword when u declare ur gameobject in the gamemanager script. 'static' helps players remain constant throughout diff scenes
  • You can try marking the player object as DontDestroyOnLoad();. This way the object doesn't get destroyed when loading another scene.

    autoCleanUpPlayerObjects is important for clients who are leaving the room. By default a client's object get removed when he leaves the room. If you disable this option, the client's object will remain in the room unless it gets closed.
Sign In or Register to comment.