Unity MRTK2 Hololens Development Setup
Follow Along To Gather All The Necessary Dependencies To Build And Deploy A Unity App To Hololens Using The Mixed Reality Toolkit 2 (MRTK2)
Follow Along To Gather All The Necessary Dependencies To Build And Deploy A Unity App To Hololens Using The Mixed Reality Toolkit 2 (MRTK2)
In this article we are going to be gathering the necessary dependencies to build and deploy a Unity app to Hololens using the Mixed Reality Toolkit 2 (MRTK2). The MRTK 2 supports both Hololens 1 and 2 as well as OpenVR. However, building to the Hololens requires a Windows OS to install the Windows SDK.
When using Unity and MRTK2 we’ll need the following items:
Before we get started, we’ll need the latest Windows Updates on both our PC and Hololens. Go to Settings -> Update & Security -> Windows Updates and click Check for Updates. Once we’re up to date, we are ready to move on.
We recommend installing Visual Studio 2019 through the Visual Studio Installer to easily add all of the dependencies for Hololens development. When installing, make sure to check the .NET desktop development, Desktop development with C++ and Universal Windows Platform development workloads. Under the Universal Windows Platform development optional packages, check C++ (v142) Universal Windows Platform tools. If you already have VS 2019, you can run the VS Installer and click Modify by VS 2019 to add the components.
Once you have VS 2019 and its workloads installed, you may want to set it as Unity’s editor. To do this, go into Unity and under Edit -> Preferences -> External Tools change the External Script Editor to Visual Studio 2019. If it’s not an option you can Browse to the .exe and open it. (Ours is under D:/VisualStudio/2019/Common7/IDE/dotenv.exe, yours may differ)
The easiest way to install Unity’s UWP Build Support is by using Unity Hub. Under the Installs tab, click on the three dots at the top right of your Unity installation, then click Add Modules. For Unity 2019, there is one option Universal Windows Platform Build Support. For Unity 2018, there are two, UWP Build Support (.NET) and UWP Build Support (IL2CPP). The choice is up to you, .NET Build Support is no longer in Unity after 2018 and was replaced by IL2CPP. The .NET module builds faster and allows C# script editing in the Visual Studio Solution that Unity builds to.
You will need to set this up on both you PC and Hololens. First, go into Settings -> Updates & Security -> For Developers and then turn Developer Mode. You can turn on Enable Device Portal on your Hololens, if you’d like to connect to it through Windows Device Portal. However, this isn’t necessary to build over USB.
The Holographic Remoting Player app lets us quickly test our Unity scene through Play mode directly on our Hololens. This is very helpful to quickly test our app. Make sure your Hololens is fully updated, then go to the Microsoft Store and install the app. You can also do this directly on your Hololens.
In conclusion, we have installed everything we need to begin Hololens development with Unity using MRTK2! Now you are ready to create a simple Hololens app with Unity.
At SLIDEFACTORY, we’re dedicated to turning ideas into impactful realities. With our team’s expertise, we can guide you through every step of the process, ensuring your project exceeds expectations. Reach out to us today and let’s explore how we can bring your vision to life!
Looking for a development partner to help you make something incredible?