Develop
Develop
Select your platform

Shared Scene Sample (deprecated)

Updated: Apr 14, 2026
OculusXRSceneActor Deprecation
OculusXRSceneActor is deprecated. New features will be delivered through MR Utility Kit.
Refer to the following as guidance on which APIs to use:
New projects:
Existing projects:
This sample app demonstrates a shared scene experience based on Shared Spatial Anchors, Scene, and Passthrough in Unreal.
The sample is available in the Unreal-SharedSceneSample GitHub repository. See Setting Up Your First Project for setup instructions.

Project Overview

The sample is built with Blueprint and reuses a significant part of the Shared Spatial Anchors sample and Scene sample. As the application starts, it loads the Lobby level and prompts a user to host or join the session over LAN. Selecting any of these options loads the Shared Spaces level. A host user can:
  • Enter the built-in OS scene capture
  • Create a shared anchor
  • Share the scene with other connected users
Joining as a client loads an empty level with a Passthrough layer and allows you to toggle object visibility as soon as the host shares the scene data.
All Blueprints can be split into the following three categories: User Interface, Spatial Anchors Management, and Scene Reconstruction.

User Interface

User Interface Blueprints correspond to menus attached to controllers. These menus are populated at runtime and are context dependent. Building blocks for those (BP_Menu, BP_MenuItem) are located in the Blueprints/UI folder as well as an anchor info widget (BP_AnchorInfo). The Blueprint of the Lobby menu (BP_Lobby_Menu) is more straightforward and is an easier starting point for understanding the interface implementation.
User interface menu 1
The next Event Graph view, from BP_Menu_Main, demonstrates the Host menu population and how the content changes depending on the active state (specifically Create, Save, and Share).
BP_Menu_Main Event Graph showing host menu population logic with Create, Save, and Share states.
It’s important to mention BP_MenuManagerComponent (a component of BP_SharedSpacesPawn) containing basic and utility code to update menu position, navigation, selection, etc. To notify a user of continuous (async) operations, the menu provides Start Async and End Async utilities that you can find in other Blueprints.

Spatial Anchors Management

The high-level Spatial Anchors management Blueprint (BP_SpatialAnchorManagerComponent) is also a part of BP_SharedSpacesPawn. It provides functionality to create, save, load, and share spatial anchors by translating calls to the lower-level API and providing delegates for async operations. The implementation is similar to the dedicated Shared Spatial Anchors sample. This sample features anchor creation and storing anchors to the cloud.
Spatial anchors management menu1
Spatial anchors management menu2
Both operations are asynchronous and trigger the corresponding event dispatch handled in BP_MenuManagerComponent with Update Main Menu. Sharing anchor data and retrieving it on a Client are explained in the next section.

Scene Reconstruction

The scene sharing starts with an anchor sharing from BP_SpatialAnchorManagerComponent and follows the scene info serialization. The Host shares the anchor with connected Clients based on available Meta user IDs obtained from the Online Subsystem.
Scene reconstruction1
The scene info contains the ID of the shared anchor, arrays with the label, transform in the shared anchor reference frame, and reference to the static mesh for each scene object. This structure is defined as BP_Scene in the Blueprints folder.
Scene Blueprint folder option
Immediately after serialization, this structure is multicasted (with NetMulticast_LoadScene from BP_OculusSceneActor) to all clients to retrieve the anchor and reconstruct the scene. The Blueprint function SpawnSceneActors to spawn static mesh actors is also in BP_OculusSceneActor.
Scene reconstruction2
BP_OculusSceneActor inherits AOculusXRSceneActor, providing basic Scene API functionality for the Host, and is directly placed on the SharedSpaces map.
In addition, semantic labels of the scene actors are stored on Clients to toggle group visibility from the Event Graph of BP_OculusSceneActor with the Blueprint function ToggleVisibility.
Scene reconstruction3
Anchor discovery APIs
This sample uses QueryAnchors, which is based on the older XR_FB_spatial_entity_query extension. For new projects, prefer DiscoverAnchors, which uses the newer XR_META_spatial_entity_discovery extension. QueryAnchors is not formally deprecated, but DiscoverAnchors is the recommended anchor discovery API going forward.

Next steps

The Scene Actor API used by this sample is deprecated. Mixed Reality Utility Kit (MRUK) provides the replacement API with additional features and improvements.