[Resolved]Problem after Updating to PUN+ 1.58

Options
Hello,

I recently updated our PUN version to 1.58, fixed the PunRPCs with the automatic upgrade, then went into my scenes and let it correct the photon IDs. I did this because when I upgraded, I went to a new scene, deleted my PUN folder, and imported the new version (I didn't have an option to just "Update"). Then I went through my scenes and let it update the photon ids and whatnot.

The problem is that since this update, my "GameManager" object, no longer persists from the start screen into the game world screen. I have DoNotDestroyOnLoad in, and it has been in there for quite some time now and used to work. So most of the game logic is broken now.

Is there a change to how Photon works that could cause an object to destroy when switching scenes? The GameManager photonview does belong to the scene, but it always has as far as I know. Is there some setting that I may need to change? I tried switching between Fixed, Takeover and Request (simply because I haven't seen that field before) on the RPC, but that didn't produce any different results.

Thank you very much for your help!

Comments

  • iHaveReturnd
    Options
    As an update, did a little testing and only objects with photonviews do not make it to the next scene. This used to work, we were using this on a photon object for at least a year. So I suppose something changed in Photon. As another note, we hadn't updated photon in a while so the change could have happened some time ago.

    Is there anything anyone knows of that was changed in photon that effects dontdestroyonload?

    EDIT (resolution):
    Appears that the issue was caused by a duplicate photon ID. I'm guessing that in the older version of PUN it didn't care about those issues as much and ignored it or handled it differently. I changed the photon ID of my game manager manually to something other ids would not get to, and it worked.
  • Tobias
    Options
    This could be related to more strict handling of the IDs, yes. A while ago, that changed considerably (to be faster and less error prone).

    If you need to assign PhotonViews in Scenes and want to keep those objects when switching the level, then take a look at the PunSceneSettingsFile. It lets you define scenes and their respective minimum ViewId number. So they don't overlap. You need to edit the scenes after you set them up in the file. In each, select at least one PhotonView and set a "too low" ID. It should auto-fix all ViewIds in the scene.