Getting Started with Vuforia in Unity 2017.2

Vuforia in Unity 2017.2

Unity 2017.2 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 Platform at developer.vuforia.com

Vuforia 6.5 is commercially available in Unity 2017.2.  

About Vuforia

Vuforia 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 platform supports AR app development for Android, iOS, and UWP devices. See: Vuforia Supported Versions

This Getting Started guide will show you:

  • How to install Vuforia with the Unity 2017.2
  • How to activate Vuforia in your projects
  • How to access Vuforia’s features in Unity. 

Installing Vuforia

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

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

Vuforia Image

Create a new Unity project

Vuforia Image

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

Vuforia Game Objects

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

Vuforia Image

Activate Vuforia in your project

You must activate Vuforia in your project before you will be able to build a Vuforia app, or use Vuforia in Play Mode. Go to Player Settings to activate Vuforia under the "XR Settings" section

Vuforia Image

Accessing Vuforia features in Unity

After activating Vuforia, you can add features of the Vuforia SDK to you project from the Unity GameObject Menu.

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

2. Press Open Vuforia Configuration

Vuforia Image
Vuforia Image

3. Activate the target Databases

Load and Activate the target databases you want to use – we recommend loading and activating all of them if you’re new to Vuforia and want to evaluate all of the target types.

Tip: 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

4. Add targets to your scene

You can add Vuforia targets to your scene by selecting the associated Game Objects in the GameObject> Vuforia menu. A target Game Object will added in your scene hierarchy and 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 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. Also see Vuforia Play Mode for Unity

Building and running your app

Vuforia 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 supports a variety of optical and video see-through stereo rendering displays including HoloLens, the ODG R-7, and a range of VR viewers for smartphones.  See: Digital Eyewear

To configure you project for stereo rendering, and support these displays, you will need to enable VR Support in XR Settings. You will then need to add a VR SDK to the accompanying list.

For HoloLens - add HoloLens as the top VR SDK. See: Developing Vuforia Apps for HoloLens

For all other stereo rendering devices - add Vuforia as the top VR SDK. See: Working with Digital Eyewear

You'll also want to configure the Digital Eyewear component on the ARCamera in your scene. Review the linked articles for more information.

Learn more

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