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:
3D and 2D data representations locked into place for easier physical navigation
Signs to provide users with instructional or general information
Decorations
Game elements that benefit from being located in the same space like a floor anchored element
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
Beginner: No coding or graphics experience | 1 hour
Intermediate: Some coding or graphics experience | 30 minutes
Advanced: Both coding and graphics experience | 15 minutes
Expert: A lot of experience with computer graphics | 15 minutes
Usage: Evaluation of tools's use for the following purposes
Art - Spatial anchors would be a great way to create virtual museums or display art that is anchored.
Game design - Spatial anchors are used in game design to anchor menus, key game pieces, and readable assets.
Science - Large data visualizations that are difficult to navigate and collaborate on benefit from spatial anchors keeping a visualization in one place.
Education - Discussion and learning on anchored assets can be made easier by understanding where someone should be looking and having a central reference point.
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
Meta Spatial Anchors Overview
Explore Meta Quest Features with Building Blocks
Spatial Anchors Tutorial
Passthrough Basic Tutorial
For more resources and information on Spatial Anchor Tutorials, please follow the link to the Spatial Anchor Tutorial Wiki page