Windows XR: Microsoft doesn’t recommend using the Windows XR plugin for any new projects in Unity 2020. Instead, you should use the Mixed Reality OpenXR plugin. However, if you’re using Unity 2019 and you need AR Foundation 2.0 for compatibility with ARCore/ARKit devices, this plugin enables that support.
[!IMPORTANT] Using this plugin in Unity 2019 is not compatible with Azure Spatial Anchors.
Legacy XR:
If you’re still on Unity 2019 or earlier, Microsoft recommends using the Legacy Built-in XR support. While the Windows XR plugin is functional on Unity 2019, we don’t recommend it because it’s not compatible with Azure Spatial Anchors on Unity 2019.
If you’re starting a new project, we recommend that you install Unity 2020 instead and use the Mixed Reality OpenXR plugin.
In the Projects tab, click New Project.
:::image type=”content” source=”../../images/001-new-project.png” alt-text=”Screenshot of Unity Hub in Projects tab with the New Project button highlighted.”:::
Click the drop-down underneath New project and then select the Editor version you want.
:::image type=”content” source=”../../images/002-editor-version.png” alt-text=”Screenshot of Unity Hub with the Editor version drop-down displayed.”:::
In the Location box, click the folder icon, and then navigate to the folder where you want to save your project and select it. You can also create a new folder.
:::image type=”content” source=”../../images/003-name-and-location.png” alt-text=”Screenshot of Unity Hub with 3D, Project Name, Location, and Create highlighted.”:::
Click Create Project. This opens your project in Unity.
:::image type=”content” source=”../../images/004-project-open-in-unity.png” alt-text=”Screenshot of your project open in Unity.”:::
[!CAUTION] When working on Windows, there is a MAX_PATH limit of 255 characters. Unity is affected by these limits and may fail to compile if any file path is longer than 255 characters. Therefore, we recommend that you store your Unity project as close to the root of the drive as possible.
On the menu bar, select File > Build Settings….
To build an app for Windows Mixed Reality, you must choose a build target. The build settings for Universal Windows Platform (UWP) target any device, including immersive headsets like the HP Reverb G2. This is the best choice if you’re building for the HoloLens 2; however, if you’re targeting desktop VR, we recommend that you use the PC, Mac & Linux Standalone platform.
Do one of the following:
If you’re targeting Desktop VR:
If you’re targeting the HoloLens 2:
Build Type: D3D Project
Target SDK Version: Latest Installed
Minimum Platform Version: 10.0.10240.0
Visual Studio Version: Latest installed