Explore Meta Quest Features with Building Blocks
Updated: Aug 5, 2024
Building Blocks are a Unity extension designed to help you discover features you can add to your Meta Quest app with Meta XR SDKs.
Each Building Block represents an atomic piece of Meta Quest functionality. After adding a Building Block to a scene, all of the feature’s dependencies are installed automatically for you. Any required configuration is also done automatically with the
Project Setup Tool.
This page provides basic instructions for adding Building Blocks to an existing project in Unity.
To use Building Blocks, you need the following:
A new 3D Unity project configured for XR development
Meta XR SDKs for features that you want to explore
Meta XR Core SDK, which is required for all Building Blocks, includes essential XR features like the Meta XR camera rig, controller and hand input, and mixed reality features like passthrough and spatial anchors. It does not include all Meta XR features. To access Building Blocks for all available features, you can install the
Meta XR All-in-One SDK. To access Building Blocks for just a subset of features, you can install individual SDKs. For example, for Building Blocks for interactions like ray, poke, locomotion, and grab, you need the
Meta XR Interaction SDK, and for Building Blocks for spatial audio features, you need the
Meta XR Audio SDK.
For the full list of Meta XR SDKs offered as UPM packages, see the
Developer Center.
Add Building Blocks to your project
To add a Building Block to your Unity project:
- Open your project in the Unity Editor.
Navigate to Meta > Tools > Building Blocks.
The Building Blocks window appears. From this window, you’re able to discover the features that you can add to your project as Building Blocks.
Note: You can also access Building Blocks by selecting the Meta icon at bottom right of the Unity Editor Status Bar.
- Choose a Building Block for a feature that you want to try out in your project, and then drag and drop it onto your scene or click the Add Block to current scene icon on the bottom right corner of the Block.
To take a closer look at the Building Blocks in your scene:
- Select the [Building Block] GameObject in the Hierarchy.
In the Inspector, look at the Building Block component.
Every installed Block comes with a Building Block component. By inspecting this component, you can find useful information about how it’s being used in your project, including:
- The Block’s name and a thumbnail representing the feature.
- Under Dependencies, a list of Blocks the current Block depends on. Selecting the icon to the right of a dependency will show the Block in the scene hierarchy.
- Under Used By, a list of Blocks that depend on the current Block. Selecting the icon to the right of a dependent Block will show the Block in the scene hierarchy.
Suppose that you want to add a realistic and responsive 3D representation of a user’s Meta Quest controllers to your app, using Meta XR Core SDK’s controller tracking capabilities.
To do this with Building Blocks:
Open your Unity project.
Navigate to Meta > Tools > Building Blocks.
Add the Camera Rig to your scene by clicking the Add Block to current scene icon on the bottom right corner of the Block.
The
Camera Rig Building Block contains the
Meta XR camera rig prefab, a fundamental part of every scene in a Meta Quest Unity application.
After adding the Camera Rig Building Block, delete the Main Camera in your scene, if one exists.
The Camera Rig Building Block replaces the Main Camera with the Meta XR camera rig prefab.
Add the Controller Tracking Building Block, which implements controller movement tracking in your app.
Recall that after adding a Building Block, all required dependencies and configurations are handled automatically for you.
With your Meta Quest headset connected to your computer, and the device selected as the build target, build and run the project.
Put on your headset and interact with the 3D representation of each of your Meta Quest controllers.
To learn more about individual Building Blocks, read the feature documentation corresponding to the Building Block. For example, to learn more about Meta XR interactions, see
Meta XR Interaction SDK Overview.
After you’ve learned about exploring new features of Meta XR Core SDK, you are ready to learn more about
Inputs and Interactions.