Caution: Fraudulent or imitation websites may appear. Only this site is official. Report concerns on our Report Fraud page.
The Multiplayer Setup section explains how to prepare your project for online play using Photon and PlayFab.
This is where everything comes together: authentication, room creation, player spawning, syncing, and the core systems that make multiplayer actually work in‑game.
This page covers the high‑level setup, while the subpages break down each part step‑by‑step.
1. What Multiplayer Setup Covers
This section handles the entire flow of getting a player from:
Main Menu → Authentication → Region → Room → Spawned Player
It includes:
Connecting to Photon
Authenticating with PlayFab
Selecting a region
Creating or joining rooms
Spawning the player prefab
Initializing player properties
Setting up the networked VR rig
Handling disconnects and errors
This is the backbone of your multiplayer experience.
2. Multiplayer Flow Overview
A complete multiplayer flow looks like this:
Launch game
Connect to PlayFab
Authenticate with Photon using PlayFabID
Select region (auto or manual)
Enter main menu
Create or join a room
Photon loads the room scene
Spawn the networked player prefab
Initialize player properties (cosmetics, name, staff, etc.)
Begin gameplay
Every VR multiplayer game follows this same structure.
3. Required Components
To set up multiplayer, you need:
A. Photon Setup
App ID
Region settings
PUN2 or Fusion (CYOGF assumes PUN2)
PhotonServerSettings configured
B. PlayFab Setup
Title ID
Login method (Device ID recommended)
CloudScript enabled
Authentication configured
C. Player Prefab
PhotonView
Head + hand sync
Cosmetic attach points
Player properties initializer
D. Room Logic
Room creation
Room codes
Room properties
Max players
Region selection
E. Scene Management
Menu scene
Room scene
Spawn points
4. Multiplayer Setup Subpages
This section contains several detailed subpages:
1. Connecting to Photon
How to initialize Photon, set the region, and handle connection callbacks.
2. Authenticating With PlayFab
How to log in, get the session ticket, and authenticate Photon securely.
3. Creating & Joining Rooms
How to create rooms, join rooms, use room codes, and handle errors.
4. Player Spawning
How to spawn the networked VR player prefab and initialize properties.
5. Handling Disconnects
How to detect disconnects, return to menu, and show error messages.
Each subpage will walk through the exact setup.
5. Best Practices
Always authenticate Photon using PlayFabID
Never spawn players manually — let Photon handle it
Use a dedicated room scene
Keep the player prefab lightweight
Use Custom Player Properties for cosmetics
Use Room Properties for map/mode
Validate everything with PlayFab
Handle disconnects gracefully