Apr
25
2019

Simple Image Tracking AR Android app using Vuforia

How to build simplest possible android AR app in “few” steps. ( No coding at all! )

  • Download Unity 2018.3.x https://download.unity3d.com/download_unity/06548a9e9582/UnityDownloadAssistant-2018.3.13f1.exe
  • Install with these 3 options selected: [x] Unity, [x] Android Build Support, [x] Vuforia support. *Visual studio might be listed here also, if you don’t already have it, install that also.
  • Start Unity, Create new Project
  • File / Build settings… Switch to Android platform
  • From Player Settings, do all these:
    • XR Settings / Enable [x] Vuforia Augmented Reality Support *If you didn’t install Vuforia plugin initially, it should open downloader here.
    • Company Name: Change it from DefaultCompany to something else, otherwise build fails
    • Other Settings / Package name: Change the default value into something else, like com.myar.vuforiaar, otherwise build fails
    • [ ] Android TV Compatibility should be disabled by default already (otherwise build fails)
  • From Unity menu, select GameObject / Vuforia Engine / AR Camera
    • “import vuforia engine assets” appears, click Import
  • In Hierarchy window
    • delete old “Main Camera” gameobject
    • Select “ARCamera” gameobject and click “Vuforia Engine Configuration” in the inspector
  • *Optional: You can click that download new vuforia engine version and install it (probably need to close unity at that point)
  • In Vuforia Configuration
    • Click Add License (it opens website https://developer.vuforia.com/license-manager )
    • Log in or create vuforia account
    • Once you are in at https://developer.vuforia.com/vui/develop/licenses
    • Click “Get Development key”
    • License name: whateverAR, [x] check box, Click Confirm
    • From License manager list, click your newly created license name and copy that long string and Paste it into “App License Key” field in unity inspector (at Vuforia Configuration)
    • Click “Add Database” (opens website https://developer.vuforia.com/vui/develop/databases?dataRequestedForUserId= )
    • Click “Add Database”, give some name, Type = Device
    • Click that newly created database from the list
    • Click Add Target, Single Image, Width = 1 (then image equals 1 unity unit), name: anythinghere
    • And for the image, select your AR target tracking image (this is the image that objects will appear into. If you dont have printer, google some image of a product that you have at your house, like some product logo, milk box side image, and crop & upload that)
    • If after upload the Rating value is very low, you might have issues tracking with this marker, try something else
    • Then click “Download Database All”, Select a development platform: Unity
    • Double click the downloaded unitypackage to import it to your project
  • From Unity Menu, GameObject / Vuforia Engine / Image (adds image tracker to scene, it should contain your marker image already)
  • In Hierarchy window
    • Select “ImageTarget” gameobject
    • Right click over it, 3D Object/Sphere
  • 3D sphere is now child of your “ImageTarget” gameobject, this means, once the tracker is detected, these child objects will become visible at this position. You can move and resize the sphere if want to. (or add other objects there)
  • CTRL+S to save scene, lets say create folder Scenes/ and save ardemo.scene there
  • File / Build Settings
    • Click “Add Open Scenes”, to add your scene into build list
  • Hit “Build” button, set output path for .APK somewhere and wait
  • Done! Your first AR app should now display 3D sphere when the marker is visible on device camera.

2 Comments + Add Comment

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch Instagram

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.