Null ref exception when entering playmode after upgrading project

Options
I recently upgraded my project to Unity 2020.1.17f1.
Photon Realtime was working nicely before the upgrade but now I get a nullref error:
Photon.Pun.PhotonNetwork.AddCallbackTarget (System.Object target) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:85)
Photon.Pun.MonoBehaviourPunCallbacks.OnEnable () (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:225)

NullReferenceException: Object reference not set to an instance of an object
Photon.Pun.PhotonNetwork.ConnectUsingSettings () (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetwork.cs:1069)
PhotonManager.Start () (at Assets/_content/scripts/photonNetworking/PhotonManager.cs:32)

And also for voice:

NullReferenceException: Object reference not set to an instance of an object
Photon.Voice.PUN.PhotonVoiceNetwork.OnEnable () (at Assets/Photon/PhotonVoice/Code/PUN/PhotonVoiceNetwork.cs:200)

NullReferenceException: Object reference not set to an instance of an object
Photon.Voice.PUN.PhotonVoiceNetwork.OnDisable () (at Assets/Photon/PhotonVoice/Code/PUN/PhotonVoiceNetwork.cs:210)

- Configuration of project should be good to go, pasted the app ID for realtime and voice.
- A standalone build works and succesfuly spawns my playerprefab.
- Also checked my firewall settings which should be fine.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @BLAVR,

    Thank you for choosing Photon!

    Try to update to the latest PUN 2 version and retry.
  • BLAVR
    Options
    Hi JohnTube,

    Thanks for your reply.
    I realized it was the experimental play mode. It has to be turned off for Photon to work.