Developing Vuforia Engine Apps for Magic Leap

Vuforia Engine offers beta support for the Magic Leap One Creator’s edition eyewear device. Use the Vuforia Engine to build powerful AR experiences for the Magic Leap devices using Vuforia’s many features including; Image Targets, VuMarks, and Model Targets. Combine robust tracking of the physical environment and objects with the Lumin OS and create augmented instructions to workers and visitors, or spark joy with immersive effects for toys, cars, and appliances. Start your Vuforia and Magic Leap journey here with setting up the Vuforia Engine, Magic Leap Lumin SDK, and the Unity Editor.

For a guide on how to connect your Magic Leap device, see Magic Leap’s Connect Device documentation.

Start by installing the tools for developing with Vuforia Engine and Unity.

  1. Download a Unity Editor version supporting Magic Leap and Vuforia Engine.
    • Install Unity with the support module for Lumin OS (Magic Leap) Build Support included in the installation.

  1. Create a new empty Unity 3D project with the Unity Editor version that supports the Lumin OS.
  2. Add Vuforia Engine to the project.
  3. Add the Lumin SDK to Unity.

Follow Magic Leap’s guide to download and set up the required resources for Unity.

NOTE: Install the latest Magic Leap Unity Package as well as the Lumin SDK.

Setting up Vuforia Engine and Lumin SDK in the Unity Editor

  1. In the Unity project, go to Edit (Unity on Mac) -> Preferences -> External Tools and browse to the folder location where you have installed the Magic Leap Lumin SDK. It is usually found at /Users/<User-folder>/MagicLeap/tools/unity/Vx.xx.x

  1. Navigate to Build Settings and press the Switch Platform button to change to Lumin.
    1. While in the Build Settings window, select the Player Settings and go to the expandable menu Other Settings and ensure that API Compatibility Level is set to .NET 4.x.
  2. Next, download the Magic Leap XR Plug-in package available in Window -> Package Manager

  1. Go to Edit -> Project Settings -> XR Plug-in Management and in the tab with the Lumin icon, check the box for Magic Leap for the Plug-in Providers.

At this point, your project is ready for the preconfigured Magic Leap Vuforia Sample. Head over to Working with the Vuforia Magic Leap Sample in Unity to get started.

For a custom set up, continue with the steps below.

  1. Import the Magic Leap Unity Package by navigating to Assets -> Import Asset -> Custom Package.
  1. Select the Magic Leap Unity Package. The packages can be found in the directory: [User]/Magic Leap/Tools/Unity/Vx.xx.x

NOTE: if you receive an “API update required” notification, go ahead and press ‘I made a Backup, go ahead!'.

  1. Return to the Project Settings’ Player configuration panel.
  2. Go to Publishing Settings to sign your Magic Leap application.
    1. Check the box for sign package and add your Magic Leap certificate. See Get a Developer Certificate if you do not yet own one.

Unity has now set up with the Lumin SDK and the Vuforia Engine.

Adding Vuforia Components

  1. Start by replacing the Camera GameObject with the Magic Leap Main Camera Prefab located in Assets->MagicLeap->Core->Prefabs.
  1. Proceed to add the following components to the Magic Leap Main Camera GameObject.
    • Vuforia Behaviour
    • Default Initialization Error Handler

  1. We can now add Vuforia's Image Target feature to the project. Go to GameObject -> Vuforia Engine and select Image Target. Choose the Image Target type from the inspector. See Image Targets to learn about databases, instant Image Targets, and Cloud Recognition. Selecting Database lets you import a default Vuforia Image Target Database.
  2. Add a Cube GameObject as a child to the ImageTarget GameObject
    • You can use Unity's hand, move, rotate, and scale tool to align the cube on top of Image Target.

Manifest settings

  1. In Edit -> Project Settings go to MagicLeap -> Manifest Settings and change the minimum API level to level 7. 
  2. Add the following privileges in the expandable menus Autogranted, Sensitive, and Reality.
    • Autogranted
    • Internet
    • LowLatencyLightwear
    • PcfRead
    • Sensitive
    • LocalAreaNetwork
    • Reality
    • CameraCapture
    • ComputerVision

  1. Save the project and Save the scene.
  2. Go to File-> Build and Run. This should compile and install the .MPK file on your ML device given that it is connected. A new window will ask whether to allow the application to access camera etc. Grant all permissions and look at the Image Target, in this case, the default database’s astronaut image.

You can print the ImageTarget for testing from Assets/Editor/Vuforia/ForPrint/ImageTargets/target_images_USLetter.pdf