๐ Stumbled here on accident? Start with the introduction!
๐ This article provides a comprehensive guide on setting up Unity for MR development with the Meta Quest 3. It covers the installation of Unity, creation of a new 3D project, installation of necessary packages, and configuration of the XR-Plug-in, equipping you with the foundational steps needed to begin developing MR applications on the Meta Quest 3 platform using Unity.
โน๏ธ If you find yourself facing any difficulties, remember that you can always refer to or download the code from our accompanying GitHub repository
About Unity
Unity offers a robust and flexible development platform for MR applications, providing extensive support for immersive experiences with its advanced rendering capabilities, comprehensive asset library, and wide-ranging compatibility with various MR hardware.
Install Unity Editor via Unity Hub
Install Unity Hub, create an account and get Unity 2023.2.3f1
with Android Build Support
.
โน๏ธ If you're wondering why Android build support is necessary, it's because the Meta Quest 3 operates on a modified version of Android 12.
We are using the latest 2023.2.3f1
build to have access to ARFoundation 6.0
. You can read more about the topic here: Access AR Foundation 6.0 in Unity 2023.2 | AR Foundation | 6.0.0-pre.5.
Create a new Unity 3D (URP) project
This series of articles will utilize the Universal Render Pipeline (URP)
instead of the default render pipeline.
โน๏ธ If you're unfamiliar with URP, or the Universal Render Pipeline in Unity, you can gain a thorough overview by following this link: Universal Render Pipeline (URP) | Unity.
Create a new project 3D (URP)
within the Projects tab. Make sure you select the Editor Version 2023.2.3f1
.
Install required packages
Open your projects manifest.json
file and append the following required packages.
โน๏ธ To find the manifest.json
file in Unity, you need to navigate to your Unity project's directory on your computer. Inside the project folder, look for the Packages
folder. The manifest.json
file will be located within this folder. This file is used to manage project dependencies and Unity package versions, making it a critical part of Unity project configuration.
"com.unity.xr.arfoundation": "6.0.0-pre.4",
ย ย "com.unity.xr.interaction.toolkit": "2.5.2",
ย ย "com.unity.xr.meta-openxr": "1.0.1",
ย ย "com.unity.xr.openxr": "1.9.1"
Save the file and return to the Unity Editor. If you get the following warning choose โyesโ.
Configure the XR-Plug-in
Find the XR Plug-in Management
settings via Edit โ Project Settings. Make sure to edit both Windows, Mac, Linux (Desktop)
settings and Android
settings.
First configure Desktop
by enabling OpenXR
as seen in the next screenshot.
Then, switch to Android
and also enable OpenXR
and the Meta Quest feature group
as seen n the next screenshot.
Add the Meta Quest Touch Pro Controller Profile
to the list of Enabled Interaction Profiles
for Desktop and Android build. For details on the available controls, refer to the Meta Quest Pro Touch Controller Profile | OpenXR Plugin | 1.9.1 documentation.
For desktop we only need to add the controller profile as seen in the next screenshot.
Switch to the Android
tab, add the controller profile and enable all features in the Meta Quest
feature group. The features are most likely already enabled.
At present, you might come across one or more issues during the Project Validation process. To address these, use the Fix All
option. However, be aware that Fix All
won't resolve all warnings in your project, as depicted in the forthcoming screenshots. This situation is acceptable, as we will be addressing and resolving these warnings manually throughout the course of our article series.
Using the Meta Quest Link Cable
Meta Quest Link provides a simplified method for skipping the Android build process in Unity. However, it lacks critical features such as Plane Detection and Passthrough, rendering it ineffective for real-world mixed reality application testing. Presently, there is no indication as to whether or when these capabilities might be implemented.
Alternatively, you can switch to Android within the Build Settings
in Unity. Follow these steps:
- Access the
Build Settings
by navigating to File โ Build Settings. - Make sure to add the
SampleScene
viaAdd Open Scene
toScenes in Build
. Normally theSampleScene
is already included so you can properly skip this step. - Select
Android
as a Platform and press theSwitch platform
button at the bottom right.
With this setup, we now have two methods to launch apps on the Meta Quest 3: without passthrough directly from the Unity editor, and with passthrough using the Build and Run
feature. The build and run process deploys the app as an Android app to your Meta Quest 3, but it takes significantly longer than simply pressing the play button in Unity. Weโll start by using the the first method and later switch to Build and Run
.
Next article
In our next article, we will introduce a key component in MR development: the Session Component. This feature plays a crucial role in managing the MR session, effectively serving as the backbone of any mixed reality application.
Top comments (0)