Skip to main content
Version: 12 Dec 2024

MRTK 3 Magic Leap Quick Start

The fastest way to get started with MRTK3 on Magic Leap 2 is to use the Magic Leap MRTK3 Template Project. The Template project is pre-configured for Magic Leap and contains all of the required MRTK3 and Magic Leap packages in addition to some sample scenes. This guide includes step-by-step instructions on how to download the Magic Leap 2 MRTK Template Project.

Prerequisites

Before starting, download and install the following packages from the Magic Leap Hub:

  • Magic Leap SDK v1.2.0 (or later)
  • Magic Leap Unity SDK v1.8.0 (or later)
  • Unity Editor v2022.2.17f1 (or later)
note

If updating to Magic Leap Unity SDK 1.10.0 or 1.11.0, there may be a compile issue if your project contains the Unity OpenXR package. A workaround for this is to remove the OpenXR package from the project in this situation.

Option 1 : Magic Leap 2 MRTK3 Template Project

You can download the mrtk3_MagicLeap2 branch from Magic Leap's forked MRTK3 repository.

  1. If you are familiar with Git and are using the command line, you can clone the repo and target the mrtk3_MagicLeap2 branch with following command:
git clone --branch mrtk3_MagicLeap2 https://github.com/magicleap/MixedRealityToolkit-Unity.git
  1. Once downloaded, open the Unity Hub
  2. Open the MRTK Dev Template Project (Located inside the MixedRealityToolkit-Unity/UnityProjects/MRTKDevTemplate directory)
  3. Once the project is opened, make sure to change the target platform to Android inside Build Settings
  4. Once complete, you can start developing Magic Leap 2 applications using MRTK3
The Hand Interactions Examples scene inside the Unity Dev Template Project
Windows Only: Failed to load ... one or more of its dependencies could not be loaded.

If importing the plugin results in Unity showing an error similar to the one below in the console, you may be missing additional runtimes ("Workloads"). This dependency can be installed is supplied by Microsoft: Microsoft Visual C++ Redistributable latest supported downloads.

Plugins: Failed to load 'C:/AppDirectory/Library/PackageCache/com.magicleap.soundfield@3.4.0-230405.66.cf20c31/Plugins/x86_64/AudioPluginMSASpatializer.dll' because one or more of its dependencies could not be loaded.

If errors are still present, close the project and delete the project's Library folder, then re-open Unity to reimport the existing packages. Then switch the Build target to Android.

Option 2 : Original MRTK3 Template Project

This guide references the MRTK 3 Template Project. However, you can apply these instructions to any project that is configured for MRTK 3. If you want to follow along using the Template Project, refer to the steps below for downloading it from GitHub.

  1. Download MRTK3's default template project from MRTK's Github repository.

If you are familiar with Git and prefer to use the command line, clone the repo following command:

git clone https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity.git

Update Project Settings

Follow the step-by-step instructions below to update the MRTK Dev Template project to Unity v2022.2.x and configure the project settings for Magic Leap 2 development.

  1. In the Unity Hub, and select Open
  2. Navigate to MixedRealityToolkit-Unity\UnityProjects\MRTKDevTemplate directory and open the MRTKDevTemplate project using Unity 2022.x.x
  3. Unity may prompt you with a notifications to verify the upgrading the Editor version:
    1. On the Change Editor version? popup, select Change version.
    2. On the Opening Project in Non-Matching Editor Installation popup, select Continue.
    3. On the Script Updating Consent popup, select Yes, for these and other files that might be found later.
  4. Download and Install the Magic Leap Setup Tool from the Unity Asset store.
  5. Once installed, use the Project Setup window to configure your project settings. Complete all the steps in the project setup tool.

Configure MRTK3 for Magic Leap

With the editor version updated, follow the instructions on the Configure MRTK3 for Magic Leap Guide for instructions on how to import and get started with the MRTK3 Magic Leap Package.