Setup of Unity for HoloLens
Author : Tejaswinee Devane Subject : Setup of Unity for HoloLens

Setup of Unity for HoloLens

Introduction of Unity:

Unity is a cross-platform game engine developed by Unity Technologies, for creating games in both 2D and 3D. Unity supports building games for many platforms such as iOS, Android, Windows, PlayStation, Oculus Rift, HTC Vive, HoloLens and many more.

This guide shows you how to install Unity Personal on Windows; however, installing Unity on macOS follows a very similar procedure.

Installing Unity Hub on Windows:

Follow the below steps to install Unity Hub on Windows: 

Step 1: Visit the official unity website and download the installer using any web browser.

You can visit the download page of Unity website

Fig.: Unity Website

Step 2: Click on Download for windows, downloading of the executable file will start shortly. It is a small 103 MB file that will hardly take a minute.

If  you are using Mac then Download Unity Hub separately

Step 3: Now check for the executable file in downloads in your system and run it.

Fig.: Executable File

Step 4: It will prompt confirmation to make changes to your system. Click on Yes.

Fig.: Dialog from Unity Hub

Step 5: Select the components you would like to be installed with Unity and click “Next”. Note: If you ever want to change the components, you can re-run the installer.

Step 6: The next screen will be of License Agreement, click on I Agree.

Fig.: License Agreement

Step 7: The next screen will be of installing location so choose the drive which will have sufficient memory space for installation.

Fig.: Dialog of Unity Hub Setup

Step 8: After this installation process will start and will hardly take a minute to complete the installation.

Fig.: Installation of Unity Hub

Step 9: Click on Finish after the installation process is complete.

Fig.: Completion of Unity Hub Setup

Step 10: Unity Hub is successfully installed on the system and an icon is created on the desktop.

Fig.: Unity Hub Icon

Step 11: Run the software and see the interface.

Fig.: Interface of Unity Hub

Congratulations!!! You have successfully completed one mile.


Set Up Unity for HoloLens Project:

Step 1: Create an Account for Unity Projects. Click on the left top button.

Fig.: Dialog to create a Unity Account

Step 2: Click on Create Account. It will throw you to a page where you need to create your Unity ID

Fig.: Create a Unity ID

Step 3:  Create a Unity ID

Fig.: Unity ID dialog

Step 4: Click on Create a Unity ID. Then this window will occur.

Fig.: Confirm your Email dialog

Step 5: You’ll get the email. Confirm and verify your email ID.

Fig.: Dialog to confirm your Email

Step 6: Sign In into your Unity ID

Fig.: Dialog to signing Unity

Step 7: You’ll get the following window after Signing In.

Fig.: Dialog after signing into Unity

Step 8: Install the editor version of Unity. Click on Installs

Fig.: Install dialog in Unity

Step 9: Click on Install Editor. You’ll get the following window. Click on Install Button of the newly updated version of unity editor.

Fig.: Install Unity Editor window

Step 10: Select following modules. You can get a visual studio here in modules.

No alt text provided for this image
Fig.: Modules to choose from Unity Editor

Then click on Continue.

Step 11: Click on Install

Fig.: Dialog to install Android SDK and NDK

Step 12: It will start the installation process.

Fig.: Installation process of Unity Editor started

Step 13: The present modules will be following

Fig.: Modules in current Unity Editor

Congratulations!!! You’ve successfully completed the second Mile.


Set Up HoloLens 2 Project in Unity:

To build our HoloLens 2 application we will use the Unity game engine. Follow these steps to configure and build a Unity project for HoloLens 2.

Step 1: Open Unity and create a new 3D project

Fig.: Create 3D project

Step 2: Open File -> Build Settings and switch the platform to Universal Windows Platform. Change the Architecture to ARM64. Make sure your minimum platform version is set to 10.0.18362.0.Note: Don’t forget to click Add Open Scenes if you already have a project that you’re ready to build and test on your HoloLens 2 device or emulator. The rest of the settings should be configured as shown with the screenshot below. Finally, press Switch Platform.

Fig.: Project settings to switch the platform

Step 3: Let’s add Microsoft Mixed Reality Toolkit (MRTK) into our Unity project. Download the mixed reality toolkit for Unity from the Mixed Reality Feature Tool kit website.

Step 4: Before you can run the Mixed Reality Feature Tool, you’ll need:

.NET 5.0 Runtime And Windows 10 or 11

You can download .NET 5.0 Runtime

Step 5: Then download Mixed Reality Feature Tool Kit

Fig.: Mixed Reality Feature Tool

Step 6: Click on Download, It will give you a zip folder of this tool kit.

Fig.: Zip file of Mixed Reality Feature Toolkit

Step 7: Extract this zip folder.

Fig.: Dialog post extracting the MRTK zip file

Step 8: Run the Application of Mixed Reality Feature Tool

Fig.: Run the arrow application

Step 9: Launch the Mixed Reality Feature Tool from the executable file, which displays the start page on first launch.

Fig.: MRTK dialog

Step 10: Select Start to begin discovering feature packages

Fig.: To select the Unity project

Step 11: Selecting your Unity project

To ensure that all discovered features are supported on your project's version of Unity, the first step is to point the Mixed Reality Feature Tool to your project using the ellipsis button (to the right of the project path field).

Fig.: Dialog to add location of Unity project

The dialog that's displayed when browsing for the Unity project folder contains '_' as the file name. There must be a value for the file name to enable the folder to be selected.

Step 12: Discover Features. Check the Mixed Reality Toolkit Foundation dialog.

No alt text provided for this image
Fig.: Discover Features of MRTK

Step 13: Click on Get Features

Step 13: Click on Get Features

Step 14: Click on Validate. It will say No issues detected.

Step 14: Click on Validate. It will say No issues detected.

Step 15: Click on Import

Fig.: Review window MRTK
Fig.: Unity Project Updated window

Step 16: Click on Approve and then exit the window. Open Unity Now and click on the Yes button of the following window. It will reopen Unity.

Fig.: Dialog post reopen of Unity

Step 17: MRTK Project Configuration

Fig.: MRTK Project Configurator in Unity

Step 18: Click on Unity Open XR plugin. Then the following window will occur.

Fig.: MRTK Project Configurator

Step 19: Click on Show XR Plug-in Management Settings and check the following items in dialogs. 

Depth Submission Mode - Depth 16 Bit

Add Interaction Profiles

  1. Eye Gaze Interaction Profile
  2. Microsoft Hand Interaction Profile
  3. Microsoft Motion Controller Profile

Fig.: XR Plug-in Management
Fig.: OpenXR settings

Step 20: Click on Next of MRTK Project Configurator and press the Apply button.

Fig.: MRTK Project Configurator

Unity will reopen now.

Step 21:  Click on Mixed Reality -> ToolKit -> Add Scene and Configure

Fig.: Add to Scene and Configure

Step 22:  Create a cube in scene.

Fig.: Create a cube in Hierarchy window of Unity

Step 23: Give functionality to cube like following in the Inspector window.

Fig.: Modify in Inspector window of Cube in Unity

Congratulations!!! You have made the Unity Project for HoloLens2.

Tip: The cover image curtesy - xrtoday.com

To view or add a comment, sign in

Others also viewed

Explore content categories