Unity3D – AR Augmented Reality using Vuforia | Getting started with AR | Setup your first AR Game | Part 1


In this tutorial, we’ll be setting up our first AR Game from scratch. If you’re worried about technology and latest devices, then don’t be anymore because for developing AR games with Vuforia, all you need are these things,

Unity Vuforia AR – Devices required

Integrating Vuforia with Unity3D:

  • Create a new Unity project
  • Go to File > Build Settings > Player Settings > XR Settings
  • Click Download Vuforia plugin for Unity or click HERE.
  • Download Vuforia plugin and install it
  • Now again go to File > Build Settings > Player Settings > XR Settings
  • And check Vuforia AR supported
  • Now, when you go to GameObject menu, you’ll notice a new item called Vuforia
Unity Vuforia XR Settings
Unity Vuforia AR real world applications

Steps (Creating our first AR app):

  • First of all, delete the default Main Camera from the scene
  • Let’s go to GameObject menu > Vuforia > Image (Image target)
  • And click import (if it asks to import the asset)
  • Let’s go to GameObject menu > Vuforia > AR Camera
  • Rotate camera so it looks towards Image target
  • Now click AR Camera that you just created and click “Open Vuforia Configuration” in the inspector panel
  • Here, it’ll ask you for App License Key, and some other options. You have to register to Vuforia’s developer console to get your app’s App License Key. Don’t worry, it’s free for personal and Educational purposes. And if you are already registered, click log in
  • Go to License Manager and click Get Development Key and create it for your app/game
Vuforia App License Key
  • Copy paste it into App License Key field of Vuforia Configuration (inside Unity editor)
Steps to create Vuforia Database (Online):
  • Go to Target Manager and click your app/game’s name
  • Click Add Target button
  • Click Single Image
  • Upload your image file (you’ll need this as a hard copy with yourself while testing)
    • So for this, you better draw some shapes on a paper and take its picture and then upload it
AR Drawing Image Target
  • But the image should be very clear otherwise it won’t work. Use better camera and draw a filled shape (not just a few lines)
  • Now click Download Database (All) button, check Unity Editor and click Download
Unity Vuforia Download Database
  • Import this database (.unitypackage) file into your Unity3D project
  • Now select Image Target GameObject that we created in our Unity scene and in Image Target Behavior component,
    • Set type to predefined
    • Set Database to your own database name
    • Set Image Target to the image of your choice (that you just drew and uploaded)
  • Create a cube as a child of Image Target GameObject and give it appropriate size
  • Go to Build Settings and change platform to Android and build the project
  • Install it on your device and grant it all permissions (camera and microphone)
  • Then place your drawing in front of phone’s camera, you’ll notice that the camera recognizes the image (from the database we created online) and placed cube in top of it

There you go! You successfully developed your very first AR app.

That’s a very basic functionality of AR using Vuforia. But that’s not all, you can create endless functionalities using Unity and Vuforia and take your imagination to limits.

Unity Vuforia AR real world applications

That was the first part of this tutorial. In the next parts, we’ll go through all the development stages of AR from beginner to expert level. So keep in touch.

I’ll see you in the next part with more features and techniques of AR.

Watch this tutorial step by step on YouTube HERE.

Tags: , , , , , , , , , , , ,

Leave a Reply

Notify of