How to update Unity project from Photon Unity Networking v1 to v2 (PUN to PUN 2)

I’d like to update my current Unity project from PUN to PUN 2. I’ve tried “updating” PUN from the asset store but that didn’t seem to do anything. I then tried just downloading PUN 2 in the asset store and then I got a bunch of errors from PhotonRealtime about how certain type or namespaces couldn’t be found. My base problem is that I’m trying to access PhotonNetwork.LocalPlayer (which doesn’t seem to be apart of the original PUN?) and after downloading PUN 2, I still can’t access it. Is this something I need to change in my Applications on my online Photon account? Any advice is appreciated. Thanks!

Hey there,

basically you just uninstall photon, then you install photon 2.
The problem that you get a bunch of errors is that some namespaces changed their names.

For example PhotonNetwork is not Pun.Realtime.PhotonNetwork. → you have to add some usings to your scripts.

The migration notes containing the most important changes can be found HERE.

the most annyoing thing is that certain callbacks are now part of interface classes that you have to add as parent class to your own class. This in return means that you have to implement all callbacks of that interface, even if you leave it empty.

Hope this helps, if anything was not clear on this let me know