A simple game I made to get into Augmented Reality using Unity and Vuforia. Available on the Google Play Store.
Matthew Hallberg (YouTube channel) for the tutorials on how to use Vuforia.
Inition (@Inition) for the insights they gave me on 3D animation.
By default, the game uses the following marker:
This can be changed by following the instructions below.
The app has the following three custom scripts, coded in C#, within the "/assets/_Scripts" folder:
Name | Description |
---|---|
AnimalsController.cs | Script responsible of moving the animals in the direction of the virtual joystick. |
AnimalSpawn.cs | Allows the user to pick an animal from a menu. |
AutoFocus.cs | Used to configure Vuforia to use autofocus on the device's camera. |
Each script includes in-line comments explaining what the line is used for.
- Begin by downloading the project and opening it into Unity. Note the project was last used in
Unity 2018.1.6f1
. - Navigate to the
_Scenes
folder, and load themain
scene by double-clicking it. - Select the
AR Camera
component from the hierarchy, and under theVuforia Behaviour
component, click onOpen Vuforia Configuration
. - Press the
Add license
button just below the App License Key field. This step is required for Vuforia to be enabled. You will be redirected to the Vuforia Dev Portal. Login or register with a free account, and generate a new license key. - Copy the license key and paste it into the
App License Key
input field encountered in step 3.
To change the AR marker, head over to the Vuforia Target Manager and create a new Database
of type device
. Open the newly created database, and add at least 1 target. Download the database for the Unity editor. Open the .unitypackage
file and import its contents into Unity.
Select the Image Target
component from the hierarchy, and select your database from within the Image Target Behaviour
as well as your Image Target
.
Make sure you have the required software installed beforehand. Open the Build settings
dialogue from the File
menu, and press Build
.
Follow Unity's Getting started with iOS guide.