Photon Networking

Instant VR Edge supports Photon networking for multi user environments, but it does not include the Photon package itself, so you have to import it manually.


You have various options for Photon:

  • Photon Unity Networking Free. Supports up to 20 concurrent users (CCU).
  • Photon PUN+ ($99). Supports up to 100 concurrent users (CCU).
  • Photon Voice. Same as Unity Networking Free, but with support for Voice Chat.

Import one of these packages into your project. InstantVR should detect automatically that a Photon package is available in the project.

Setup you Photon account using the instructions in the PUN Setup popup window. If it does not appear, you can open it manually using Window Menu -> Photon Unity Networking -> PUN Wizard.

Scene setup

For the connecting to the Photon server and basic matchmaking, InstantVR Edge provides a PUN Manager Starter script. It uses the following parameters:

  • Room Name: all players with the same room name share the same space.
  • Game Version: for each room, different versions can be created
  • Send Rate: the number of updates per second sent across the network
  • Player Prefab: the prefab which is used to spawn new players.
  • Player Object: the player’s game object when it has been spawned.

For more advanced setups for matchmaking we refer to the Photon documentation: Photon Matchmaking Guide.

Player Prefabs are instantiated in the PUN Manager Starter script using Photon.Instantiate. The Player Prefabs should have the IVR_Photon Avatar script and a Photon View script attached to them. The Photon View script should have IVR_Photon Avatar script as Observed Component. You can ensure this by dragging the IVR_Photon Avatar script title onto the Observed Components list.

The IVR_Photon Avatar script has two parameters.

  • Avatar FP: First person avatar. This is the same prefab you use in single player setups. For instance MH_VRSteamVR if you want to support the HTC Vive.
  • Avatar TP: Third person avatar. This is the prefab with the avatar other players will see in their environment. It can look different from the first person avatar. This prefab should only have the InstantVR  and IVR_Body Movements scripts on it

Changing the avatar mesh

The first and third person avatar can both be changed in the prefabs in the parameters of the IVR_Photon Avatar script.

Photon Voice

For voice chat support, make sure that you have included the Photon Voice package.

In the Photon Server Settings (found in Photon Unity Networking/Resources), set the Voice AppId to the same App Id you use for setting up Photon.

Make sure that the first-person avatar has an audio listener on the head target. From InstantVR v3.8 all included prefabs have this included already.

Select the Player Prefab you use (For example the included MH_VR_Photon prefab).

Add the Photon Voice Recorder script to the Player Prefab.

That’s it. Voice chat should work now.