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.
Before proceeding with this tutorial, complete the setup steps outlined in
Set Up Unity for XR development to create a project with the necessary dependencies.
Building Blocks in SDKs
Meta XR Core SDK is required for Building Blocks. It includes essential features such as the Meta XR camera rig, controller input, hand input, and mixed reality features like passthrough and spatial anchors. To use Building Blocks for a specific feature, install the related SDK. For example:
For a complete 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:
From the top menu bar, navigate to Meta XR Tools > Building Blocks.
A window named Building Blocks should appear. From this window, you can discover and add the building blocks available
from the Meta XR SDKs included in your project.
- Locate the building block you want to add and click the preview image to view a description.
- Click Add Block to import it into your scene.
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 is 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.