A single Unity project can produce a VR headset build and a mobile observer app that both
join the same live multiplayer session. The two builds share the same networking logic and game
systems; what differs per platform is which scenes are included, how XR is configured, and which
player prefab is spawned on join.
SINGLE PROJECT, MULTIPLE BUILD TARGETS
Use Build Profiles to give each platform its own independent scene list. Your VR build gets the
VR scene; your mobile build gets the observer scene. Both can still reference a shared bootstrap
scene that handles session connection before handing off to the platform-specific scene.
Because both Quest and flat Android target the same OS, use scripting define symbols in each
Build Profile to tell them apart at compile time. This keeps your platform-conditional code
explicit and prevents XR-specific systems from initialising on non-XR hardware.
SEPARATING XR FROM NON-XR
In Project Settings > XR Plug-in Management, enable XR providers only for the VR platform
profile. For the mobile observer profile, leave XR disabled entirely — this prevents the XR
runtime from starting on a device that doesn't support it.
Back this up with conditional compilation to guard any VR-specific code paths, so the XR SDK is
stripped from the mobile binary at build time.
JOINING THE SAME SESSION
Both builds connect through Multiplayer Sessions using the Multiplayer Services package, which is platform-agnostic. The VR client creates a session and generates a join code; the mobile observer uses that code to join the same session. Neither client needs to know or care what platform the other is running on.
On join, the server reads each client's role and spawns the appropriate prefab, a full VR rig
for the headset client, a lightweight observer object for the mobile client. The session itself
is shared; only the local representation differs.
KEY TAKEAWAYS
- One environment, one Unity project and two Build Profiles, each with its own scene list and XR configuration.
- Scripting define symbols distinguish platforms that share an OS target.
- Sessions connect the same way for both clients.
- Role-based spawning gives each client the right in-world representation without splitting the session.