Photon PUN 2


In order to use Photon PUN 2 in your project. You need to import the Photon PUN 2 package first from the asset store.

After this, go to the Edit Menu->Preferences. Humanoid Control will check the availability of the package and the Photon Networking option should appear in the Networking Support property:

When Photon Networking is selected for Networking Support, networking support components like the Networking Starter and Networking Transform should adapt automatically to Photon Networking.

The Grocery Store Networking demo scene will now support Photon Networking.

Networking Starter

When using Photon PUN 2, the Networking Starter component has the following options:

Networking PrefabThe player prefab which will be spawned across the network. This defaults to HumanoidPlayer for Photon Networking.
Room NameThe name of the environment shared by the players
Game VersionThe version of the environment shared by the players
Send RateThe number of updates per second communicated through the network.

Self Hosted Networking

For local networking Photon PUN, go to the following page: Then select ‘Server’:

And download the SDK. 

Instructions on how to set it up can be found here:

The settings you need to use in Unity for Photon 2 are as follows:

In this case, we use a direct IP Address (localhost/127.0.01), so Use Name Server is disabled.
As the protocol is Udp, you need to set port to 5055. Other port numbers can be found here:

If you start the scene now, Photon should connect to the local server.