Creating a New MRTK3 Project
This guide provides instructions on how to create a new Magic Leap 2 project that uses MRTK 3. See the Magic Leap MRTK 3 Overview page for information on which features are currently supported on Magic Leap 2.
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)
Create a Magic Leap 2 Project
Ensure that you have a Unity project configured for Magic Leap 2 development. If you have not configure a project for Magic Leap 2, follow the Configure Unity Settings instructions.
Import Standard MRTK 3 Packages
Before importing the Magic Leap MRTK3 Integration Package, make sure to configure your project for MRTK3. This section offers general guidance on downloading and installing MRTK3 packages using the Mixed Reality Feature tool or microsoft's NPM web portal.
- Mixed Reality Feature Tool
- NPM Web Portal
Use these instructions to install MRTK3 dependencies into your existing Magic Leap 2 project using the Mixed Reality Feature tool. Note that the Mixed Reality Feature Tool is only available for Windows.
Close the Unity project before using the Mixed Reality Feature tool.
- Open the Mixed Reality Feature Tool.
- Target your Unity project and select Discover Features
- At a minimum, install the following required packages: Note: If you do not see MRTK3, you may need to select the Show preview releases option located at the bottom of the window.
- MRTK3 / MRTK Input
- MRTK3 / MRTK UX Components - After choosing the packages to install, click Get Features. This will display the package dependencies.
- Add the packages to your project by pressing Import then Approve.
- Finally, select Exit to close the Mixed Reality Feature Tool. For more information, see Microsoft's Starting from a new project guide.
Open the Unity project
- Open the Unity project and wait for Unity to finish importing newly added packages.
- Clear any errors that appear due to missing dependencies from a prefab or XR provider.
If your development environment does not support the Mixed Reality Feature Tool, you can download the required packages via Microsoft's NPM Web Portal.
Microsoft's NPM does not support being added to the Unity Package Manager as a registry and requires you to download the packages online manually.
Downloading the Packages
This section provides instructions on how to download and import the MRTK 3 packages without the Mixed Reality Feature Tool.
- At a minimum download the required MRTK3 Packages. (Required packages are listed in bold.)
We recommend placing the packages in your projects root directory to more easily track your project's dependencies and to make your project more compatible with version control systems.
- Open the Package Manager inside your project (Window > Package Manager)
- Select the + icon, then Add package from tarball...
- Select and import each of the packages downloaded in Step 1 in this order
org.mixedrealitytoolkit.core-VERSION.tgz
org.mixedrealitytoolkit.input-VERSION.tgz
org.mixedrealitytoolkit.graphicstools-VERSION.tgz
org.mixedrealitytoolkit.uxcore-VERSION.tgz
org.mixedrealitytoolkit.spatialmanipulation-VERSION.tgz
org.mixedrealitytoolkit.standardassets-VERSION.tgz
org.mixedrealitytoolkit.uxcomponents-VERSION.tgz
For more information on MRTK 3 packages and their dependencies, see Microsoft's package overview page.