Exercise - Import and configure resources

Completed

Install the Mixed Reality Feature Tool

To import the Mixed Reality Toolkit into your project we'll use the Mixed Reality Feature Tool, which allows developers to discover, update, and import feature packages. You can search packages by name or category, see their dependencies, and view proposed changes to your project's manifest file before importing.

  1. Download the latest version of the Mixed Reality Feature Tool from the Microsoft Download Center.

  2. After the download finishes, open the MixedRealityFeatureTool.exe file and use it to launch the Mixed Reality Feature Tool.

    Note

    Before you can run the Mixed Reality Feature Tool, you might need to install the .NET 6.0 runtime.

Import the MRTK Unity foundation package

  1. In the Mixed Reality Feature Tool, select Start.

    Screenshot of the Mixed Reality Feature Tool opening screen.

  2. Select the Browse button (it's the "three-dot" button in the image below), then navigate to your project, and then open it.

    Screenshot of the Select Project screen.

    After you select a folder, the Tool checks to ensure that it's a valid Unity project folder.

    Screenshot of the Mixed Reality feature Tool Project Path screen.

  3. Select Discover Features.

    Note

    You might need to wait a few seconds while the Tool refreshes the packages from the feeds.

  4. On the Discover Features page, note that there is a list of available package groups.

    Screenshot of the main groups of packages in the Mixed Reality Feature Tool.

  5. Select the + button to the left of Platform Support (0 of 5) and then select the latest version of Mixed Reality OpenXR Plugin.

    Screenshot of package selections in the Mixed Reality Feature Tool.

  6. Select the Select All button to the right of MRTK3 so that all features are selected.

    Screenshot of selecting all feature of MRTK3.

    Note

    If you see any packages that are marked as deprecated, you should remove them and make sure that Settings > Feature > Show deprecated packages is deselected.

  7. After you've made your selection(s), select Get Features.

  8. Select Validate to validate the packages you selected. You should see a dialog that says No validation issues were detected. When you do, select OK.

  9. On the Import Features page, the left-side column, Features, displays the packages you selected. The right-side column, Required dependencies, displays any dependencies. You can select the Details link for any of these items to learn more about them.

  10. When you're ready to move on, select Import. On the Review and Approve page, you can review information about the packages.

  11. Select Approve.

  12. Select Exit.

  13. Return to the Unity Editor and select a blank area in the UI. You'll see a progress bar showing you that your packages are being imported.

Configure the Unity project

  1. After Unity has imported the packages, a warning appears asking if you want to enable the backends by restarting the editor. Select Yes.

    Screenshot of Unity Restart Option.

  2. Unity will ask you about updating methods in the XR InteractionLayerMask, select the I Made a Backup, Go Ahead! button and wait for Unity to restart.

    Screenshot of updating methods in the XR InteractionLayerMask.

  3. On the menu bar, select Mixed Reality > Project > Apply recommended project settings for HoloLens.

  4. On the menu bar, select Edit > Project Settings.... Select XR Plugin-in Management. Ensure that Initialize XR on Startup is selected, and then, under Plugin Providers, select Open XR.

    Screenshot of Initialize XR on Startup.

  5. The OpenXR Plugin loads, and then two items appear underneath OpenXR. Select the first one, Microsoft HoloLens feature group. Select the yellow exclamation mark.

    Screenshot of Open XR option.

  6. Select Fix All.

    Screenshot of Fix All.

    Some warnings may remain. Ignore them for now.

  7. Select OpenXR under XR Plug-in Management.

  8. Under Interaction Profiles, add Microsoft Hand Interaction and Eye Gaze Interaction Profile if they haven't been added.

    Screenshot of Add Interaction Profiles.

  9. Make sure Microsoft Hololens on the left is selected and Hand Tracking, Mixed Reality Features, and Motion Controller Model on the right are selected.

  10. Select the warning sign next to Eye Gaze Interaction Profile to bring back the Project Validation window. Make sure you're on the UWP platform tab (the tab displays the Windows logo), and then select Fix All to resolve the validation issues. Note that there may be issues that remain after you select Fix All. In that case, select Fix All again, ignore any issues that are marked Scene specific, and then read the recommendations for the remaining issues (if any) and make any changes you want.

  11. Under Project Settings, Select MRTK3, then check if there is a valid Profile. If there is none, search for MRTKProfile in the project's Packages (Packages/org.mixedrealitytoolkit.core/Configuration/Default Profiles/MRTKProfile.asset) and assign it to the Profile.

    Screenshot of MRTK profile.

Configure project settings

  1. In the menu bar, select Edit > Project Settings.

  2. In the Project Settings window's left-side column, select Player.

  3. Note that in the Player window, the Product Name is "MRTK Tutorial." This is taken from your project name and will be the name displayed in the HoloLens Start menu.

    Screenshot of Unity Publishing Settings with the Project Name box filled in.

    Tip

    To make the app easier to locate during development, add an underscore in front of the name to sort it to the top of any list.

  4. Select the Publishing Settings drop down, and then in the Package name field, enter a suitable name; for example, MRTK-Tutorials-Getting-Started:

    Screenshot of Unity Publishing Settings with the package name box filled in.

    Note

    The package name is the unique identifier for the app. If you want to avoid overwriting previously installed versions of the app with the same name, you should change this identifier before deploying the app.

  5. Close the Project Settings window.

Create the scene and configure MRTK

  1. In the menu bar, select File > New Scene. Select the Basic (Built-in) option, then Create.

  2. In the Project window, navigate to the Packages > MRTK Input > Assets > Prefabs folder. Drag the prefab MRTK XR Rig into the scene Hierarchy.

    Screenshot of the adding MRTK XR Rig in the Inspector.

  3. Remove the Main Camera game object because MRTK XR Rig game object already contains a camera.

    Screenshot of the Mixed Reality Toolkit in the Inspector.

  4. Add the MRTK Input Simulator (Packages > MRTK Input > Simulation > Prefabs) prefab to your scene.

    Note

    This step is optional, but required by in-editor simulations.

    Screenshot of the input simulator.

  5. In the menu bar, select File > Save As....

  6. Navigate to the Assets > Scenes folder, then name your project, and then save your project.