A Christmas themed Augmented Reality based Treasure - Hunt Game built using Unity and AR Foundation βοΈ
There are Christmas themed items placed in the real world. Your task is to find out the items following the cues.
- Geospatial Creator API is used to place 3D models of Christmas Items at specific geolocations
- Cues to discover Christmas items
- Score system to track user's current progress
- Notification system to inform user if there is low GPS accuracy, no Internet connectivity
- Animations
- Unity Engine
- AR Foundation
- Google's ARCore Geospatial Creator Feature
- GPS and LocationService
- Enhanced Input System for handling touch events
- Particle System for Confetti animations
Play Game | Instructions | Cue |
---|---|---|
Playing Game | Christmas Item Visible | Congrats Message |
---|---|---|
Game Play |
---|
treasure_hunt_gameplay.mp4 |
The AR Treasure Hunt project can be built to create a mobile game.
The project uses Unity 2022.3.15f1 and Google's ARCore Geospatial Creator API
The Geospatial Creator API anchors christmas items to specific GPS coordinates in the real world. The API can track a user's latitude, longitude and altitude on the earth. The user needs to follow the given cues inorder to discover the items.
Note
App works best in day time.
The app will require the following:
- Internet and GPS access.
- The experience works best outdoors.
- An ARCore compatible device: Android: Google Pixel 2 or later device for optimum performance.
- Download Unity version 2022.3.15f1 for compatibility. We recommend using Unity Hub.
- Clone this repo to your machine (optionally fork this repository if you plan on expanding on it).
- Open the project in Unity 2022.3.15f1, and open the 'ARTreasureHunt' scene (if it doesn't open automatically).
- Switch platform to Android (File > Build Settings > Choose Android Platform > Click on Switch Platform)
- Follow the steps below in the 'ARCore API Key' section
- Deploy it to an ARCore compatible device (File > Build Settings > Build & Run)
You'll need to set up API access to use the ARCore Geospatial API and the Google Map Tiles API
- Create a new Google Cloud project.
- Enable the ARCore API and Maptiles API and generate API keys.
- Add the keys to your Unity Project:
- Open Unity Project Settings (Edit > Project Settings)
- Under 'XR Plug-in Management', click on 'ARCore Extensions'
- Paste the ARCore API Key into the 'Android API Key' textfield
- 'Geospatial' and 'Geospatial Creator' should be turned on
- Open the ARTreasureHunt Scene by Double Clicking it (Projects window > Assets > Scenes)
- Click on 'AR Geospatial Creator Origin' from the Hierarchy window
- Paste the Map Tiles API Key under 'AR Geospatial Creator Script' component in the Inspector window
- Open the ARTreasureHunt Scene by Double Clicking it (Projects window > Assets > Scenes)
- Click on any Christmas Item Model in the Hierarchy window (eg. Christmas_Tree)
- From the Inspector window, look for 'AR Geospatial Creator Anchor' and change the values for latitude, longitude, altitude to your desired location
- To learn more about Geospatial Creator API, click here
Find and edit the ShowCue script to show proper cues according to the Christmas Item placement
Support it by joining stargazers for this repository.β
Whether you're helping us fix bugs, improve the docs, or a feature request, we'd love to have you! πͺ Check out our Contributing Guide for ideas on contributing.
For bugs, feature requests and discussion use GitHub Issues.
- Check out our other available awesome mobile libraries
- Thanks Takashi Yoshinaga for this awesome starter project GeospatialAPI-Unity-StarterKit
- Youtube video by Google AR & VR team explaining Geospatial Creator API was very helpful
- Also thanks to amazing Unity community for providing lots of useful resources
MIT License
Copyright (c) 2023 Simform Solutions
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.