Working with the Vuforia Magic Leap Sample in Unity

The Magic Leap Vuforia Sample is a great way to start developing for the Magic Leap eyewear device. The sample can be easily imported into an existing Magic Leap Unity project and requires only a few steps to get you started.

To get started with the Vuforia Sample, please follow the guide below.

Unity 2020.3 and 2021.1

Lumin SDK v0.25.0

Magic Leap XR Plugin v6.2.2

Set up your Unity Project

Ensure first that your Unity installation includes Lumin OS (Magic Leap) Build Support. You will also have to configure your project to use the Magic Leap Loader in the XR Plugin Management package. Refer to Getting Started With Vuforia Engine for Lumin for setting up Unity configurations.

NOTE: The sample will automatically prompt you to include the correct Vuforia Engine package version. Also, it already contains the scripts and assets from the Magic Leap Unity Package, so importing this package is not required for this sample. Importing another version of that package, overwriting what is included in the sample, may cause incompatibilities.

Add the Vuforia Sample

The Vuforia Sample package includes scenes with pre-configured components. Simply import it into your Unity project and build it to your Magic Leap device.

  1. Import the Vuforia Magic Leap Sample for either Unity Version 2020.3 or Unity Version 2021.1 from the Unity Asset Store.
    • Importing the Sample project might require you to Install/Upgrade Package Manager dependencies.

Set up package signing

  1. Navigate to Project Settings -> Player -> Publishing Settings. Check the box for Sign Package and continue to add your Magic Leap developer certificate. 

If you do not have one, we recommend visiting Magic Leap's Get a Developer Certificate to learn more on how to obtain one. Just remember, that you will need both the .cert file and the .privkey file in the same folder for the certificate to work.

Building to the Magic Leap Device

  1. Once the package has been imported, go to Build Settings and verify that the Vuforia sample scenes were added. Build the .MPK file to the device by pressing the Build and Run button. 

TIP: Print the Image Targets and place them next to each other to see them interact with each other.