SharedSpaces, developed by the VR Developer Tools team, showcases how to quickly gather people in VR using Oculus Social Platform APIs. This version is built for the Unity engine, utilizing Photon Realtime as the transport layer and Unity Netcode for GameObjects. There is also a version for the Unreal Engine.
This codebase serves as both a reference and a template for multiplayer VR games.
SharedSpaces networking consists of three layers. The Oculus layer provides presence information to find and connect with friends. The Photon layer handles message transport between players. The Netcode for GameObjects layer manages game object replication.
This overview explores each layer and demonstrates how they integrate to create a simple multiplayer application, allowing people to connect and play without a dedicated server.
First, ensure Git LFS is installed by running:
git lfs installNext, clone this repository using the "Code" button above or this command:
git clone https://github.com/oculus-samples/Unity-SharedSpaces.gitTo run the showcase, open the project folder in Unity 6000.0.59f2 or newer. Load the Assets/SharedSpaces/Scenes/Startup scene.
Upon loading the scene, you may see this pop-up:
Click "Import TMP Essentials" to import the necessary TextMesh Pro assets.
To get the sample working, configure the NetDriver with your Photon account. Their basic plan is free.
- Visit photonengine.com and create an account.
- From your Photon dashboard, click "Create A New App."
- Fill out the form, setting the type to "Photon Realtime," then click Create.
Your new app will appear on your Photon dashboard. Click the App ID to reveal the full string and copy it.
Paste your App ID in Assets/Photon/Resources/PhotonAppSettings.
The Photon Realtime transport should now work. Verify network traffic on your Photon account dashboard.
The Meta packages are referenced in the Packages/manifest.json file; update them using the Package Manager within the Unity Editor.
To keep the project organized, the Photon Voice 2 package is stored in the Packages folder. To update, import their updated Asset Store packages, then copy them into their respective Packages folders.
The Photon Voice 2 package is released under the License Agreement for Exit Games Photon.
The Photon Realtime package is referenced in Packages/manifest.json as com.mlapi.contrib.transport.photon-realtime.
First, ensure Git LFS is installed by running:
git lfs installThen, clone this repository using the "Code" button above or this command:
git clone https://github.com/oculus-samples/Unity-SharedSpaces.gitThe majority of Shared Spaces is licensed under MIT LICENSE, however files from Photon SDK are licensed under their respective licensing terms.
See the CONTRIBUTING file for how to help out.

