Teasure hunting in step by step

Tutorial: Inclusive treasure hunting with and without vision! ***Step by step***

What do I need ?

              • a PC
              • a compatible smartphone (list available in the table at this link https://developers.google.com/ar/discover/supported-devices) and usb cable to send a file to the smartphone (otherwise bluetooth works but is longer)
              • a set of softwares to install, as explained step by step in the tutorial: Unity, Android Build Support, ARCore package for Unity, JDK, SDK Android (Android studio)
              • a audio file, MP3 for example, which will be the sound of your treasure (it can be a sound of sonar, a beep or a music).
              • Warning ! At your first use, you need the internet to create and connect to a Unity account to enable features

What does it do when it's over?

You will be able to scan flat surfaces (for example the floor), and touch the screen of your smartphone to put a virtual object: the treasure. This treasure makes noise, in 3D, which allows to find it.

Install Unity

We will now install Unity, which allows to create video games and applications.

Download Unity

Download Unity Hub by selecting the "Personal" version on the Unity website on the download page (if you respect the conditions) https://unity3d.com/fr/get-unity/download .

Open the downloaded installation file, install Unity Hub, launch Unity Hub. In "Installs", then go to "Add" to choose a Unity 2018 or 2017 version. Accept the application to make changes on your device if you are asked.

Choose to install at least "Android Build Support".

Launch Unity

Now you have to start Unity.

Warning ! At your first use, you need the internet to connect to a Unity account (and create one if you do not have one by clicking on "create one") as requested (illustration). The next uses do not require a connection, except if you want to download a Unity element (for example, a 3D element to decorate your virtual scene in the Assets Store).

Then select your Unity user license (e.g. Unity Personal if you meet the conditions).

Prepare the necessary (the "video game" scene)

Prepare the project

Open Unity and create a new project. You can call it for example "Treasure Hunt" (do not put any accent or special characters)

This passage is a question of personal preferences. Here is how I personally organize the Unity windows, which I will use later. Here's how: Go to the top right of your unity window and click on "Layout" then select "2 by 3", as shown in the illustration.

You can then drag-and-drop to position the "Project" tab under the "Hierarchy" tab. Then, drag and drop the "Project" tab under the "Hierarchy" tab. You can then save this tab layout in Unity by clicking on the same menu but choosing "Save Layout".

Launch ARCore

Only if you have Unity2019 installed:

You have two more items to install. Go to Unity, in the menu at the top click on the Windows tab then on Package Manager: Window> Package Manager. Wait for the packages (list on the left of the window that opens) to load, and select "Multiplayer HLAPI" and "XR Legacy Input Helper." "

In all cases: Go to https://github.com/google-ar/arcore-unity-sdk/releases and scroll down to find the download file called arcore-unity-sdk-V1.9.0.unitypackage

Import it in the Unity project :

menu Assets>Import Package>Custom Package. In the window that opens, find and select the package you just downloaded. On the window that opens, check that everything is checked and import.

Once the import is complete, go to the "Project" tab, in the folder « Assets » > GoogleARCore> Examples >HelloAR >Scenes . In this folder, open the HelloAR scene.

Add the basic audio « treasure»

Create a first model treasure (i.e. a cube that makes noise), it will improve after making a first smartphone application:

Go to the menu at the top of Unity on "GameObject> 3D Object> Cube".

In the "Hierarchy" window, right click on the cube, select "Audio" then "Audio Source", now visible in the "Inspector" window.

Add the sound that will be assigned to the treasure (cube) in the project. To do this, you have to open the folder of your computer with the sound, make a "drag and drop" on the folder "Assets" in the window "Project"

Select "Source Audio" from the cube in the "Hierarchy" window. In the inspector click on the circle to the right of the "Audio clip" field and select the sound.


Move the slider "Spatial blend" to the right (3D sound).

For the sound to loop, check the "Loop" box.

Make a prefab with this object (cube + sound).

Go to "Hierarchy", select "Example Controller". In "Inspector", select the "Cube" prefab in the "Andy plane prefab" field.


Save your Unity scene.

Make the smartphone app

Install the necessary to make Android smartphone app


Install the JDK via the downloadable installer at https://www.oracle.com/technetwork/java/javase/downloads/index.html, (the square marked with Java, and "jdk" shown below).

Install Android Studio, on the page https://developer.android.com/studio .

Configure Unity. For that, go in the menu Edit> Preferences. In the pop-up, go in « External tool » partie « Android », cliqc on « Browse » et select the folder where you installed the Android SDK.

Go to the "Files" menu and select "Build Settings". (1) Select "Android" from the menu on the left, and (2) press "Add open scene" at the top right, then click on "Switch Platform" at the bottom. Finally, (4) click on "Player settings".

In "Player settings", you can put your name or the name of your institutions (instead of "Default Company"), the name of the application as it will be on the smartphone just below (no accent nor special characters ). You can choose a project image correspondind to the application icon on your smartphone in the "Default Icon" line

In the "Build Settings" window, click on "Build". Choose where to save the apk file and its name, for example AppTresor.apk.

Install via Google play the application "ARCore of Google" on your smartphone.

Put the file of your application (AppTresor.apk) on your smartphone then open it on the smartphone to install it.


Launch your "Treasure Hunting" app on your smartphone.

Point the camera at the ground or a flat surface to see a mesh appear (indicating that the application has detected the surface). Touch the screen where there is mesh, and the "treasure" appears where you touched the screen.

Use headphones or headphones. The sound is as if the smartphone was the head: tilt the smartphone is equivalent to turning the head, approaching or moving the smartphone makes the sound more or less strong.


To modify the treasure, so that it looks like a treasure chest:

In Unity, go to Window, and select "Asset Store", and search for "treasure", with "price" free

Choose an asset, for example "Treasure Set- Free Chest".

On the pop-up that opens, choose "Download", "Import" and then again "Import" in the window that opens

Venez dans l’onglet « Scene » pour drag-and-drop le prefab du trésor de « Project », à "Hierarchy".

Pour etre sur que l'objet aura la bonne orientation, vous pouvez:

  • add an "empty" object dans "Hierarchy"
  • drag and drop the chest object on it
  • verify it has the good orientation once in the empty object

Now, we have to redo as with the cube: we add an audio-source with a sound, then transform the object into prefab, and we remove it from the "hierarchy", and finally defines it as the prefab to use in Example Controller

Generate a new installation file (apk), and reinstall it on your smartphone.

It's finish!