This is a starter project to build an augmented reality app with Root insurance for the Make day course by OfferZen.
- Clone or download this starter project to your machine.
- Download and install Unity via Unity Hub. Vuforia comes bundled with Unity. While it's downloading, continue with this process.
- Get a Vuforia App Licence Key and put it in the "App Licence Key" field under
Vuforia Configuration -> Global
via the "Window" option in the app toolbar. - Create a new Vuforia "Device" database to hold your tracking images.
- Upload the following two target tracking images to your Vuforia database:
- Download your Vuforia database to a known location and import it into your Unity project.
Watch the walkthrough screencast detailing how to set up Unity and Vuforia, or jump to your area of concern:
- Register for Vuforia 00:15
- Overview of Unity 01:27
- Activate Vuforia License Key in Unity 02:10
- Turn on Vuforia "AR Support" 02:44
- Create online Vuforia database and upload image targets 03:36
- Download the Vuforia database and import it in Unity 06:50
- Manipulate an
ImageTarget
07:10 - Add a second
ImageTarget
and a prefab (prefabicated asset) 09:37 - Interact with
ImageTarget
using a script 12:25 - Collision detection between a ball and a capsule 16:30
- Reset ball position 19:35
- Make a Root API call 20:32
- Questions and Bye! 23:38
Great, you got this far. You're almost there!
- Open this repository as a project in Unity.
- Import the Vuforia "Device" database you downloaded in the previous section.
- In the bottom-left, you should see two tabs titled "Project" and "Console". Take note of any unexpected errors under the "Console" tab. Common pitfalls are addressed below.
- Under the "Project" tab, navigate to the folder
Assets -> Scenes
and open the scene calledSampleScene
. - Under the "Project" tab, navigate to
Assets -> Resources
and click onVuforia Configuration
. - Add your generated Vuforia App License Key in the Vuforia Inspector (on the right).
- Tick the
Vuforia Augmented Reality Support
checkbox underEdit -> Project Settings -> Player
. - Select the imported targed in
Image Target Behaviour
In theImageTarget
GameObject. - Click the
Play
button (middle top) and have fun!
- "My external USB webcam not listed in Vuforia." This can be caused by version migration issues, or when the webcam was unplugged while starting Unity.
- "Vuforia only tracks one target at a time." There is a default limit of 1 tracking targets.
- Right-click inside the hierachy tree (on the left) to quickly add new nodes.
- To rotate the viewport, hold Alt (on PC) or Option (on Mac) while dragging.
- To pan the viewport, hold Alt+Cmd (on Mac) or Option (on PC) while dragging.