Understand how to colocate multiple headsets in the same physical room.
Set up MRUK with the required settings for colocation.
Implement the Host and Peer flows using a simple API call.
Overview
World Lock Colocation lets multiple users in the same physical environment see, interact with, and manipulate the same mixed reality content. Unlike space sharing, which shares detailed Scene data, World Lock Colocation only requires a single shared spatial anchor, with no need to scan your room
The SetCustomWorldLockAnchor API (available since MRUK v83) lets you override the default world lock anchor with your own shared spatial anchor. This is the key primitive for colocated multiplayer alignment—making all headsets in the same room agree on where virtual objects are.
One player (the Host) creates a shared spatial anchor and records its pose—that’s the “ground truth” for where the world origin should be. Every other Peer receives that anchor and pose, then calls SetCustomWorldLockAnchor to align their coordinate system to match the Host’s.
Once aligned, MRUK automatically compensates for tracking drift, keeping virtual objects in the same physical locations for everyone.
See the World Locking section in Manage Scene Data for more information on this feature.
Use cases
Competitive Gameplay
Compete in mini-golf, tag, or strategy games sharing the same MR playfield.
Collaboration
Co-create furniture layouts, sketches, or designs in a shared augmented space.
Media Watching
Enjoy spatialized video, multi-screen displays, or 3D audio together.
Training
Practice hands-on drills or assembly tasks with synchronized 3D overlays.
Requirements
MRUK v83 or later
EnableWorldLock = true on the MRUK component
OVRCameraRig in the scene
A working Shared Spatial Anchors setup for creating and resolving anchors across devices
Warning
When EnableWorldLock is true, MRUK owns the trackingSpace transform. Use MRUK.TrackingSpaceOffset for any additional offset—don't modify trackingSpace directly.
API reference
public void SetCustomWorldLockAnchor(OVRSpatialAnchor anchor, Pose poseOffset)
Parameter
Type
Description
anchor
OVRSpatialAnchor
The shared anchor to align to. Pass null to reset.
poseOffset
Pose
The anchor’s pose on the Host device (the “ground truth”).
// Align to shared anchor
MRUK.Instance.SetCustomWorldLockAnchor(resolvedAnchor, anchorPoseOnHost);
// Reset to default
MRUK.Instance.SetCustomWorldLockAnchor(null, Pose.identity);
Step-by-step workflow
World Lock Colocation requires two separate sharing mechanisms:
var anchorGO = new GameObject("AlignmentAnchor");
var anchor = anchorGO.AddComponent<OVRSpatialAnchor>();
// Wait for anchor creation
while (!anchor.Created)
await Task.Yield();
Step 2: Share the anchor via Meta’s Shared Spatial Anchors API
This makes the anchor available for other devices to retrieve:
var users = new List<OVRSpaceUser> { /* target users */ };
await anchor.ShareAsync(users);
Step 3: Capture the anchor’s pose and share via your networking solution
The pose offset is the “ground truth” that peers need for alignment:
// Capture the anchor's current pose
var anchorPoseOnHost = new Pose(anchor.transform.position, anchor.transform.rotation);
// Share anchor UUID + pose via your networking solution (e.g., Photon room properties)
PhotonAnchorManager.PublishAlignmentAnchor(anchor.Uuid, anchorPoseOnHost);
The Host doesn’t need to call SetCustomWorldLockAnchor — MRUK’s default world locking already works for them. The API is for peers to align to the Host’s coordinate system.
Peer workflow
Step 1: Get the anchor UUID and pose from your networking solution
// Retrieve alignment data from your networking solution (e.g., Photon room properties)
Guid anchorUuid = PhotonAnchorManager.GetAlignmentAnchorUuid();
Pose anchorPoseOnHost = PhotonAnchorManager.GetAlignmentAnchorPose();
Step 2: Retrieve the anchor via Meta’s Shared Spatial Anchors API
var anchors = new List<OVRSpatialAnchor>();
var result = await OVRSpatialAnchor.LoadUnboundAnchorsAsync(
new List<Guid> { anchorUuid },
anchors
);
if (!result.Success || anchors.Count == 0)
{
Debug.LogError("Failed to retrieve shared anchor");
return;
}
var resolvedAnchor = anchors[0];
Step 3: Call SetCustomWorldLockAnchor to align coordinate systems
// This is the key MRUK call that aligns the peer to the host
MRUK.Instance.SetCustomWorldLockAnchor(resolvedAnchor, anchorPoseOnHost);
Reset when done (optional)
For experiences that shift between single-player and multiplayer modes:
This MR Motif guides you from the basics of Spatial Anchors, through network sharing with Colocation Discovery and Shared Spatial Anchors, to building fully co-located experiences.
Ensure both devices are on the same network and that the anchor was successfully shared. Check that Enhanced Spatial Services is enabled on both headsets (Settings → Privacy & Safety → Device Permissions).
🛠️ Objects Still Misaligned After SetCustomWorldLockAnchor
Verify that EnableWorldLock = true on the MRUK component. Also ensure you're passing the correct anchorPoseOnHost—this must be the pose captured on the Host's device, not the Peer's local pose.
🛠️ World Appears Tilted
MRUK filters to yaw-only rotation to keep the world level. If you see tilt, check that your anchor wasn't created at an unusual orientation. Create anchors at level surfaces when possible.
🛠️ Coordinate Systems Drift Over Time
This is expected behavior—tracking naturally drifts. SetCustomWorldLockAnchor continuously compensates for this drift every frame. If drift seems excessive, ensure the shared anchor is well-lit and has good visual features for tracking.
When to use SetCustomWorldLockAnchor vs Space Sharing
Feature
SetCustomWorldLockAnchor
Space Sharing
Purpose
Align coordinate systems across devices
Share detailed Scene data (walls, floors, furniture)
What’s shared
Single anchor + pose
Full room geometry and semantic labels
Use case
Lightweight colocation for any multiplayer app
Rich MR experiences that react to room layout
Complexity
Simpler—just one anchor
More complex—full Scene Model synchronization
Recommendation: Use SetCustomWorldLockAnchor when you just need coordinate alignment. Use Space Sharing when guests also need the Host’s Scene Model (room layout, furniture positions, etc.).