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)
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.
- 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
- Once downloaded, open the Unity Hub
- Open the MRTK Dev Template Project (Located inside the
MixedRealityToolkit-Unity/UnityProjects/MRTKDevTemplate
directory) - Once the project is opened, make sure to change the target platform to Android inside Build Settings
- Once complete, you can start developing Magic Leap 2 applications using MRTK3
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.
- 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.
- In the Unity Hub, and select Open
- Navigate to
MixedRealityToolkit-Unity\UnityProjects\MRTKDevTemplate
directory and open theMRTKDevTemplate
project using Unity 2022.x.x - Unity may prompt you with a notifications to verify the upgrading the Editor version:
- On the Change Editor version? popup, select Change version.
- On the Opening Project in Non-Matching Editor Installation popup, select Continue.
- On the Script Updating Consent popup, select Yes, for these and other files that might be found later.
- Download and Install the Magic Leap Setup Tool from the Unity Asset store.
- 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.