Spatial Anchors in Unity

Description

Spatial anchors allow for the user to "anchor" or lock a virtual object onto a physical frame of reference in the real world. This allows a virtual object to maintain the same location while in use and to remember this location in future uses. As spatial anchors rely on a physical frame of reference, they are used in mixed reality with passthrough. 

Spatial anchors can be used to anchor many virtual visualizations including:

Spatial Anchors in Unity

Spatial anchors can be set up in Unity through multiple methods. In order to use spatial anchors in an implementation with a Meta Quest headset, the necessary tools include Unity and Meta XR All-in-One SDK

For a tutorial on setting up spatial anchors, follow this link. (Tip: If you are a beginner to developing with Unity, it is recommended to start with implementing basic passthrough first. Then, progress to implementing spatial anchors.) 

Spatial anchors are now accessible for use through the Meta Building Blocks that allow for a low/no code option to implementation. For more information on Meta Building Blocks in Unity that include Spatial Anchors as well as a variety of other functionalities, please reference this link.


Metrics

Accessibility: The estimated time for someone to get it up and running

Usage: Evaluation of tools's use for the following purposes

Capabilities

With spatial anchors, the user can set the location of the anchor in their physical space, load the virtual item at this anchor, and close out of the program. The largest benefit to setting up spatial anchors via Unity and the Meta XR All-in-One SDK is that when the user reenters the space, their anchors will be remembered.  Anchors can be deleted and new anchors can be set by the user. 

Collaborative Spatial Anchors

The Meta Building Blocks allow for users to implement spatial anchors for solo use, using the [BuildingBlock] Camera Rig, [BuildingBlock] Passthrough, [BuildingBlock] Spatial Anchor Core, [BuildingBlock] Controller Buttons Mapper, and [BuildingBlock] Sample Spatial Anchor Controller.  The Building Blocks also allow for spatial anchor collaboration by using the [BuildingBlock] Shared Spatial Anchor Core.

The goal of shared spatial anchors is to allow multiple users, who are in the same physical space, to share the same anchors so users can collaborate while understanding what others are viewing. This should allow for more in depth collaborative sessions while allowing multiple users to immerse in the same visualization, anchored at the same location. It is important to note, to use the [BuildingBlock] Shared Spatial Anchor Core, the developer must have a valid Meta Organization and App ID.

Spatial Anchors Comparisons

To help inform developers on when to use spatial anchors and the functionalities compared to other functionality in Unity and outside software, please visit this wiki page.

References and Resources


Added by: Colby Rees (2025)