Getting Started with Vuforia Engine in Unity

Vuforia Engine in Unity

As of 2017.2, Unity integrates the Vuforia Engine, making it even easier to create cutting edge augmented reality experiences for both handheld and headworn devices. You can learn more about the Vuforia Engine platform at developer.vuforia.com

About Vuforia Engine

Vuforia Engine is a software platform for creating Augmented Reality apps. Developers can easily add advanced computer vision functionality to any application, allowing it to recognize images and objects, and interact with spaces in the real world.  

The Vuforia Engine platform supports AR app development for Android, iOS, and UWP devices. See: Vuforia Engine Supported Versions

This Getting Started guide will show you:

  • How to install Vuforia Engine with Unity
  • How to activate Vuforia Engine in your projects
  • How to access Vuforia Engine’s features in Unity 

Installing Vuforia Engine 

Download and run the Unity Download Assistant 2017.2 or later from the Unity website: https://unity3d.com/. Accept Unity’s license agreements.

In Unity versions before 2019.2, select Vuforia Augmented Reality Support in addition to your platform support (iOS, Android, UWP) in the Components selection dialogue. Then continue with your installation.

This is not required from Unity 2019.2 onwards since Vuforia can be added to any project using Unity’s package manager.

 

Vuforia Image

Create a new Unity project

Vuforia Image

It’s recommended that you use a 3D project set-up.

Activate Vuforia Engine in your project

You must activate Vuforia Engine in your project before building a Vuforia Engine app, or use Vuforia Engine in Play Mode. Go to Player Settings to activate Vuforia Engine under the "XR Settings" section and check "Vuforia Augmented Reality".

Vuforia Image

In Unity 2019.2 and later, this will automatically add the latest Vuforia Engine package to your project.
Alternatively, you can add the package from the Package Manager window:

Vuforia Image

Vuforia Engine Game Objects

Vuforia Engine will be visible in the Unity Game Object menu and also in Build Settings and Player Settings.

Vuforia Image

If this menu is not shown, this means that you did not install Vuforia with Unity (Unity versions before 2019.2) or did not add the Vuforia Engine package to your project (Unity 2019.2 and later).

Accessing Vuforia Engine features in Unity

After activating Vuforia Engine in Unity, you can add features of Vuforia Engine to your project from the Unity GameObject Menu. Please refer to Features Overview for more information on all of the capabilities offered by the Vuforia Engine.

Start by adding an ARCamera. This is a special camera type that supports augmented reality apps for both handheld devices and digital eyewear. 

Steps:

  1. Add an ARCamera
  2. Open the global Vuforia Configuration Inspector
  3. Activate the target databases
  4. Add targets to your scene

1. Add an ARCamera. Delete Main Camera.

Vuforia Image

Print Physical Targets

This is a good time to print some targets to work with. You can find these in /Editor/Vuforia/ForPrint. We’ve provided a complete set of high-resolution target prints to get you started.

Vuforia Image

Printable target PDFs can be found in /Editor/Vuforia/ForPrint

Add Targets to your scene

Vuforia Image

2. Add targets to your scene

You can add Vuforia Engine targets to your scene by selecting the associated Game Objects in the GameObject> Vuforia menu. A target Game Object will be added in your scene hierarchy, which will be visible in your scene.

Each target object can be configured in the Inspector.  Select the database and target name for the target you want to use. 

Adding digital assets

You’re now ready to add digital content to augment your target. You can do this by simply adding your assets as children of the target in the scene hierarchy. Parenting content with a target object automatically sets up the necessary rendering and physics behaviors (see: DefaultTrackableEventHandler.cs).

Vuforia Image

Add content as a child of the target.

Tip: Delete the default Main Camera after adding an ARCamera. The ARCamera contains its own scene Camera. You won’t need the Main Camera unless you are using it to render a specific camera view.

Playing the scene

Vuforia Engine provides a simulator in the Game view that you can activate by pressing the Play button. You can use this feature to evaluate and rapidly prototype your scene(s) without having to deploy to a device.  

Play Mode is configured in the WebCam section of the Vuforia Configuration. 

Building and running your app

Vuforia Engine-powered Unity apps are built and run in the same way as other Unity apps for Android, iOS, and UWP.

See: Building section https://unity3d.com/learn/tutorials/s/mobile-touch

Configuring a project for Digital Eyewear

Vuforia Engine supports a variety of optical and video see-through stereo rendering displays, including HoloLens and Vuzix M300. Refer to the Digital Eyewear article for more information.

Perform the following steps to configure your project for HoloLens:

  1. In the Edit menu, select Project Settings...
  2. Select the appropriate platform icon and expand the XR Settings section.
  3. Select the Virtual Reality Supported checkbox.
  4. Highlight Virtual Reality SDKs.
  5. Click the + icon.
  6. Select Windows Mixed Reality as the top SDK in the list.

Learn more

Register as a Vuforia Engine developer to access our support forums and advanced features of the Vuforia Engine platform.