Introduction: Augmented Reality Tutorial for Beginners With Vuforia and Unity 3D

Picture of Augmented Reality Tutorial for Beginners With Vuforia and Unity 3D

This tutorial shows you how to make an augmented reality app in Unity 3D with Vuforia. The game is an interactive ball maze that can be built to Android or IOS. It utilizes the front facing camera to track an image target. This video also goes through how to build the app for Google Cardboard so the game can be played with virtual reality headsets.

Print the picture of the maze above, that will be the image target that your camera is going to track. I made the image target black and white so if you're out of colored ink like me, don't worry.

Create a developer account on Vuforia and add the above picture to your image target database. Download a copy of the database for Unity 3D as well as the Vuforia plugin for Unity.

Download Unity3D if you don't already have it and make sure to add the modules for Android or IOS depending on what you want to build to.

Step 1: Set Up the Scene.

Picture of Set Up the Scene.

Import the Vuforia plugin and your image database into Unity.

In the Vuforia folder, click and drag the ARCamera prefab into the hierarchy.

Find the imageTarget prefab in the same folder and drag it into the hierarchy as well.

In the scene, move the imageTarget prefab away from the camera by a few units.

Drag it onto the ARCamera prefab (making it a child).

Using cubes create a 3D copy of the maze on top of the image target.

Make a small sphere and create a new material.

Drag the new material onto the sphere and make it a bright color.

Step 2: Almost Done...

Picture of Almost Done...

Create a cube and place it above the maze (this is going to be the spawn point for the sphere).

Remove the mesh renderer and collider of the sphere.

Add a C# script to the sphere, call it "ballScript" and paste this code:

using UnityEngine;
using System.Collections;

public class ballScript : MonoBehaviour {

	public GameObject plane;

	public GameObject spawnPoint;

	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void Update () {

		if (transform.position.y < plane.transform.position.y - 10) {

			transform.position = spawnPoint.transform.position;


Step 3: Ready to Build.

Picture of Ready to Build.

In the scene view, click the sphere, and on the ball script, drag the plane and the cube into their respective places.

In the hierarchy, drag the plane, the sphere, and the cube on top of the image target to make them children.

Click play and all should be well.

Now you are ready to build for Android or IOS.

If you want to build for Google Cardboard, click the ARCamera in the hierarchy and go to Digitial Eyewear Behavior Script in the inspector. Choose video see through -> Vuforia -> Cardboard V1. Now you have both stereo cameras and when you build to Android or IOS the app will work in your virtual reality headset.

Any questions don't hesitate to ask. Watch the video for more complete instructions.

Let me know in the comments if you have any requests for future videos.


AkshayaR2 made it! (author)2016-12-17

Hey! I made it!
The ball moves quite smoothly but gets stuck sometimes... but I'm working on it!

Next I'm going to try upgrading this set up by adding some extra stuff! Anyways thank you!

HariK156 (author)AkshayaR22017-11-25

can you plz plz plz send me project file plz

gesp1 (author)AkshayaR22016-12-27

Hi, my friend, how do I download the tutorial?

ZakiS12 (author)2017-11-13

How i can my asset ?

MarcosL62 (author)2017-06-26

I dont to works mya web cam when work by ubunu 16.04 ? Cam somebody please help?

AnkitT36 made it! (author)2017-02-09

When I add Image Target Unity database from vuforia. I am not able to see the Maze Image in Unity . Can Somebody please help ?

MohitK80 (author)AnkitT362017-02-24

same problem please someone help

kerstinhovland (author)MohitK802017-06-16

Go to Editor>QCAR>ImageTargetTextures>(Your DB)

Then in unity inspector on the top right above the open button there will be a settings button. Click on that and then click "reset".

If this doesn't work, try deleting the meta files and do the same thing you did above. - Taken from ksheetijsaini on the Vuforia forums, works for me!

ShubhamJ75 (author)AnkitT362017-02-27

Same here!! Please HELP

ebrahimk7 (author)2017-02-16

hello If I send you my unity package Do you have time for check it because that have one problem?

HOOangel (author)2016-09-28

hallo.why the ball dint move when i scan the image target?

gesp1 (author)HOOangel2016-12-27

Hi, my friend, how do I download the tutorial?

About This Instructable




Bio: My name is Matthew and I attend the University of Pittsburgh. Currently I am a senior, going for a bachelors in Information Science with a ... More »
More by matthewh8:Apple ArKit Augmented Reality AppAugmented Reality Fidget SpinnerFacial Recognition With Tracking.js
Add instructable to: