XR Step-by-Step 2023! Hololens 2: Setting up your Project in Unity 2022 + MRTK 2.8.3 + Visual Studio 2022

Virtual and Augmented Reality together are now referred to as XR or “Extended-Reality”.
You’re in the right place at the right time to build something amazing in XR!
XR applications can be created in Unity for many devices, our focus will be on Microsoft Hololens 2 and the Meta Quest 2 / Pro.

In this specific blog post series we will focus on Hololens 2 in the latest Unity and Visual Studio!

Want to see the other blog articles in this (and other) series?
Click here to see all of my XR Step-by-Step blogs separated by device and version!

Welcome! I love the Hololens!! It can solve real-world problems by bringing computational vision to industries that have never had anything as immersive as this before…

We need to get more developers working and comfortable with the tools — so together we’ll be doing just that. Buckle up, and welcome to the future of XR!

Now that we have our tools installed and configured (see XR Step-by-Step 2023! Hololens 2: Installing the Tools you need! Unity 2022 + MRTK 2.8.3 + Visual Studio 2022) we’ll setup our project!

Pretty easy with a road-map on what you need to do (which I aim to provide to you!) but non-trivial by far without a good set of instructions. Especially if you want to use the latest versions of all our awesome tools!

TL;DR -> Quick Reference summary FOLLOWED BY the detailed Step-by-Step with images!

  • !!! NOTE: Below this Quick Reference is the fully detailed Step-by-Step version with images !!!
  • (Unity Hub) Click Projects -> click New Project
  • (Unity Hub) Click Editor Version -> Click the newest Unity version
  • (Unity Hub) Click 3D template -> Set Project Name -> Choose Location -> Click Create Project
  • (Unity Toolbar) File -> Build Settings…
    • Click Add Open Scenes
    • Switch Platform to Universal Windows Platform
    • Switch Architecture -> ARM 64-bit
    • Switch Minimum Platform Version -> 10.0.18362.0 (or newer)
    • Check Copy References
    • Click Switch Platform
  • (Mixed Reality Feature Tool) Expand Platform Support -> Add Mixed Reality OpenXR Plugin to project
  • (Unity Toolbar) Edit -> Project Settings
    • Click XR Plug-in Management
    • Click Universal Windows Platform settings tab
      • Check OpenXR
      • Check Microsoft HoloLens feature group
      • Click the Warning Icon -> Click Fix All
    • Click Windows, Mac, Linux XR Plug-in Management Settings tab
      • Check OpenXR
      • Check Microsoft HoloLens feature group
      • Click the Warning Icon -> Click Fix All
      • If left with “At least one interaction profile must be added.” -> Click on Edit
        • (Project Settings -> OpenXR) Click the “+” under Interaction Profiles
          • Add Eye Gaze Interaction Profile
          • Add Microsoft Hand Interaction Profile
  • (Unity Toolbar) Mixed Reality -> Project -> Apply recommended project settings for HoloLens 2
  • (Unity) Click Project tab -> Select Assets -> Drag other MRTK Unity Packages (one at a time) into the Assets section -> Click Import after each
    • [Required] Microsoft.MixedReality.Toolkit.Unity.Foundation.2.8.3.unitypackage
      • (MRTK Project Configurator) Click Apply Settings -> Click Import TMP Essentials
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Tools.2.8.3.unitypackage
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Examples.2.8.3.unitypackage
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Extensions.2.8.3.unitypackage
    • [Optional] Microsoft.MixedReality.Toolkit.Unity.TestUtilities.2.8.3.unitypackage
  • (Unity Hierarchy) Select your scene
    • (Unity Toolbar) Mixed Reality -> Toolkit -> Add to Scene and Configure…
  • (Unity Hierarchy) Expand MixedRealityPlayspace -> Click Main Camera
    • (Inspector) Camera -> Change Background to Solid Color -> Set to black if needed
  • [Optional] Add a cube or something to your scene for verification that your project works as expected 🙂
  • (Unity Toolbar) File -> Build Settings… -> Build
  • (Windows Explorer) Click on the *.sln file in your Install folder (if you named it that)
  • (Visual Studio) Change to Release -> Change to ARM64 -> Change to Device
  • (Visual Studio) Click Build -> Deploy Solution

Full Step-by-Step Instructions!

  • (Unity Hub) Click Projects -> click New Project
  • (Unity Hub) Click Editor Version -> Click the newest Unity version
  • (Unity Hub) Click 3D template -> Set Project Name -> Choose Location -> Click Create Project
  • (Unity Hub) Click on the new project!
  • (Unity) Here’s where the XR Journey begins! This is what you should see when opening the new project.
  • We need to change the project to build for a Hololens…
  • (Unity Toolbar) File -> Build Settings…
  1. Click Add Open Scenes (this adds our current Unity scene to the Scenes in Build and checks it)
  2. Switch Platform to Universal Windows Platform
  3. Switch Architecture -> ARM 64-bit
  4. Switch Minimum Platform Version -> 10.0.18362.0 (or newer) — if you don’t see this version, then you need to update your Windows SDK see previous blog post
  5. Check Copy References (when we open up Visual Studio, this makes intellisense, etc. work!)
  6. Click Switch Platform
  • Run MixedRealityFeatureTool.exe
    • Open the folder where you saved your Mixed Reality Feature Tool to find the exe
  • (Mixed Reality Feature Tool) Click Start
  1. Set the Project Path to your new Unity project
  2. Click Discover Features
  1. Expand Platform Support
  2. Check Mixed Reality OpenXR Plugin
  3. Click Get Features
  • Click Import
  • Click Approve
  • Click Exit
  • (Unity) Open your Unity project – you will see that it’s importing the Mixed Reality OpenXR Plugin
  • Click Yes to use the new input system, and Unity will restart
  • (Unity Toolbar) Note that we now have a new Mixed Reality menu!
  • (Unity Toolbar) Edit -> Project Settings

We need to configure our Universal Windows Platform XR Plug-in Management

  1. (Project Settings) Click XR Plug-in Management
  2. Click Universal Windows Platform settings tab
  3. Check OpenXR
  4. Check Microsoft HoloLens feature group
  5. Click the Warning Icon
  • Click Fix All
  • Give Unity a little bit to make all fixes, and you’ll likely be left with “At least one interaction profile must be added…” -> Click Edit
  • (Project Settings -> OpenXR) Click the “+” under Interaction Profiles

  • Add Eye Gaze Interaction Profile
  • Add Microsoft Hand Interaction Profile

  • Next to Eye Gaze Interaction Profile-> Click the Warning Icon

  • Click Fix All

Now we need to do the same setup for the Windows, Mac, Linux XR Plug-in Management

  1. (Project Settings) Click XR Plug-in Management
  2. Click Windows, Mac, Linux settings tab
  3. Check OpenXR
  4. Check Microsoft HoloLens feature group
  5. Click the Warning Icon
  • Click Edit
  • Add Eye Gaze Interaction Profile
  • Add Microsoft Hand Interaction Profile

  • (Unity Toolbar) Mixed Reality -> Project -> Apply recommended project settings for HoloLens 2
  • Click Fix All
  • Click Edit
  • Look for all issues to be marked as good!

Now we need to add the MRTK files into our project – note, you -can- add MRTK to your project via the Mixed Reality Feature Tool however I’ve found that this doesn’t always add everything, i.e. such as all the MRTK Examples code – but dragging them in is easy and has always worked for me!

  1. (Unity) Click Project tab
  2. Click Assets folder
  3. Drag Microsoft.MixedReality.Toolkit.Unity.Foundation.2.8.3.unitypackage into the Assets section (as shown by arrow)
  • (Import Unity Package) Click Import
  • Back to Unity, the MRTK Project Configurator should appear
  • (MRTK Project Configurator) Click Apply Settings
  • (Project Settings) At this point everything -should- be good, but if anything needs to be fixed it will be highlighted
  • (MRTK Project Configurator) Click Apply
  • Click Next
  • Click Import TMP Essentials (TextMesh Pro is needed by MRTK and is generally highly useful!)
  • Click Done
  • Now add the other MRTK Unity Packages (one at a time) into the Assets section
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Tools.2.8.3.unitypackage
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Examples.2.8.3.unitypackage
    • [Recommended] Microsoft.MixedReality.Toolkit.Unity.Extensions.2.8.3.unitypackage
    • [Optional] Microsoft.MixedReality.Toolkit.Unity.TestUtilities.2.8.3.unitypackage
  • When you’re all done, you’ll see the following folders in your Assets!
  • [Bonus Content] You’ve officially configured your project! Whew…. Now let’s configure your scene!

  1. (Unity Hierarchy) Select your scene
  2. (Toolbar) Mixed Reality -> Toolkit -> Add to Scene and Configure…
  • You’ll now see the following in your scene!
  1. (Hierarchy) Expand MixedRealityPlayspace -> Click Main Camera
  2. (Inspector) Camera -> Change Background to Solid Color (set to black if it doesn’t automatically do so)
  • Let’s add a 3D cube so we have something to look at…

  1. (Hierarchy) Click SampleScene
  2. RIGHT-Click below in the Hierarchy section
  3. Click GameObject in menu
  4. Click 3D Object
  5. Click Cube
  • (Hierarchy) Click Cube
  1. (Hierarchy) Select Cube
  2. (Inspector) Change the Cube’s Transform values (as seen in the next two images)
  • (Toolbar) File -> Build Settings…
  • Click Build (assuming all the values / selections look like the following)
  • Click New Folder -> I generally create a folder named Install -> Click Select Folder
  • When building is complete, Unity should launch a Windows Explorer
  • (Windows Explorer) Click on the *.sln file in your Install folder (assuming that’s what you named it)
  1. (Visual Studio) Change to Release
  2. Change to ARM64
  3. Change to Device
  • If successful you should see the Deploy Succeeded message in the lower left corner
  • Look at that! You now have a HoloCube in Mixed Reality – congratulations!

Love any feedback and see you in future XR blog posts.

Build something amazing in XR! — Lance

Want to see the other blog articles in this (and other) series?
Click here to see all of my XR Step-by-Step blogs separated by device and version!

2 thoughts on “XR Step-by-Step 2023! Hololens 2: Setting up your Project in Unity 2022 + MRTK 2.8.3 + Visual Studio 2022”

Leave a Reply