Building HoloLens App with Unity and MRTK Part 3 (Application development)

Created by: 
Admin
May 27, 2022

We have now all the required assets and tools in our project. We can start to work on app functionality by adding more assets, interactions, scripts, and other resources. From our experience, we recommend getting familiar with MRTK components and prefabs. They are great building blocks that allow the creation of a quick and functional application.

As this tutorial is about settings correct development pipeline we will use one of the example scene to continue project build and deployment. You use your own scene with any assets as you like.

Import of MRTK Example scene

To import these examples we can use  Mixed Reality Feature Tool which we used earlier and check Mixed Reality Toolkit Examples then click Get Features.

This will also automatically choose required dependencies. Choose project path and click Import.

Now choose Window → Package Manager → In Project → Custom and select Mixed Reality Toolkit Examples.'

From the list on the right side of the panel, click Import into Project button next to the example scene names. For example, you can click Import into Project button next to Demos - HandTracking.

Now find the scene in Project View. You can choose Scenes in Search by Type dropdown to find it quickly and double click on the HandInteractionExamples

Now if you have something to work on it is good to know what tools are useful in developing process

Developing immersive applications differs from developing applications to be displayed in 2D screens. Users interact with  3D world therefore creating UI and UX is quite unique.It is very hard to know how user will experience the app just by running it in the Unity editor before building a full project.This is where Holographic Remoting comes in handy.This is a great way to quickly debug your app without deploying it on device.

1. First, you need to install the Holographic Remoting Player app from the Microsoft Store on your HoloLens 2. You'll need v2.4 or later to work with the OpenXR plugin.

2. Run the Holographic Remoting Player app on the HoloLens 2 and you'll see the version number and IP address to connect to.

3. On your HoloLens, start the Holographic Remoting Player app.

4. Now you can click Mixed RealityRemotingHolographic Remoting for Play Mode

5. Click Enable Holographic Remoting for Play Mode.

6. For Remote Host Name, enter the IP address of your HoloLens.

7. Now you can click Play in Unity Editor and experience how it works on HoloLens

💡 TIP:Most of the time however during development you will add some functionality to the UI that will not change the UI itself. To test if everything works well you can also use virtual hand tool by clicking and holding space bar (for the right hand) and/or left shift (for the left hand). Notice that this works when you have a mouse cursor in the Game view in Unity Editor.Now you can move virtual hand with mouse and mimic button click with a scroll to move your hand in and out.If you want to hold virtual hand in one place in the game view without holding space bar or shift you can also anchor them with Y key or T key respectively. Then you can gain control of the virtual hand by holding space bar or shift.

Previous section: [Part 2] -- Project Setup

Next section: [Part 4] -- Building Application

Blog posts list: