This tutorial is focused on explaining the step-by-step process of setting up a new Unity project with XR features using Oculus software
Powered by the Unity Engine, Oculus XR provides creators with an extensive toolkit to craft immersive XR experiences and push the boundaries of digital reality.
This tutorial is focused on explaining the step-by-step process of setting up a new Unity project with XR features using Oculus software, emphasizing the utilization of hand-tracking functionality over traditional controllers.
Unity, any version superior to 2021.3.26f1. (2022.3.15f1 was used to make this documentation. Please note that some steps of the process may vary).
Open Oculus Developer Hub, log in or create a new account, and select the ADB path of the Unity version you are using (the path should be something like this C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\adb.exe)
Open Oculus software, log in or create a new account, and follow the steps to connect your device.
Air link connection is recommended over cable for Unity testing.
For debugging, if you are connected by Air link, when starting Play mode in Unity, the app will execute on the Oculus device.
For installing the built APK, connect by Cable link and add it to the Apps section in Meta Quest Developer Hub’s Device Manager.
Unity project XR set up
Go to Project Settings/XR Plug-in Management and enable Oculus in all tabs.
Inside XR Plug-in Management, go to OpenXR. In the Android tab, under OpenXR Feature Groups, enable Hand Tracking Subsystem, Meta Hand Tracking Aim and Meta XR Foveation.
In Oculus section, click in “Fix All” if you have any outstanding issues.
Now in the Unity top bar, click in “Oculus/Tools/Create store-compatible AndroidManifest.xml.” Remember to update “AndroidManifest.xml” if you change app permissions.
Open File/Build Settings, select the "Android platform" and click on “Switch Platform”.
Once Meta XR Interaction SDK OVR Samples is installed, search for “OculusInteractionSampleRig.prefab” in the project “Packages/Meta XR Interaction SDK OVR Samples/Runtime/Prefabs” and add it to the scene.
Go to the OVRCameraRig, and in OVR Manager, enable the target device you are using. Select “Controllers And Hands” for Hand Tracking Support and “V2” for Hand Tracking Version in Quest Features/General.
It is also recommended to select “Floor Level” in Tracking Origin Type, and setting the Y position of the OculusInteractionSampleRig to 0.
Now, if you are connected with the Oculus device via Air link and click in “Play”, your scene will be playable on the device with hand tracking enabled. From here on, it is a matter of adding the desired functionalities.
In conclusion, we've successfully covered the process of setting up a Unity project with XR capabilities using Oculus software, with a focus on hand-tracking functionality. By following the steps outlined in this tutorial, you now have the tools and knowledge to embark on your own XR projects and explore the exciting possibilities of immersive experiences.