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 add Vuforia Engine with Unity
  • How to access Vuforia Engine’s features in Unity 
  • How to add content and test your Unity project

Adding Vuforia Engine to a Unity project

The Vuforia packages are available through a scoped NPM (Node Package Manager) registry. For more information on this, please see Vuforia Engine Package Hosting for Unity.

Import the utility script, that is available at the Vuforia Engine Download Page, into your Unity project and it will make the necessary changes to your project:

Add or update Vuforia Engine to your Unity Project (SDK Downloads)

Once the scoped registry has been added to your Unity project’s manifest .json file, the latest version of the Vuforia Engine package will be available in the Unity Package Manager UI:

Vuforia Image

To manually check if new updates are available, go to Help -> Vuforia Engine -> Check for Updates:

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. 

Keep in mind to maintain the correct scale of Vuforia targets. Using targets that deviate in size from the real-life object you wish to track might impact the quality. See Virtual Scene Scale in Unity for more information.

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 mode 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 Vuforia Configuration section and you may use webcam and simulation mode to test your Vuforia targets. See Vuforia Play Mode in Unity for more information.

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.

Next Steps

Essentials

Vuforia Engine Package Hosting for Unity 

Vuforia Play Mode in Unity

Working with Vuforia Engine in Unity

Learn More

How to Create and Load Targets in Unity

How To Use Android Plugins in Unity Apps

Virtual Scene Scale Factor in Unity

Using ARCore in Unity

Building Large Vuforia Engine Apps in Unity

AR Foundation

How to Use Vuforia Engine and AR Foundation in Separate Unity Scenes