A simple AR game made with Unity and Vuforia! Plates spawn on a table, shoot at them with your toy gun to earn points!
This game was an experiment for my AR class where I tried to recreate an old arcade-style game with weird input peripherals. The AR gun is the weird input in this case. To achieve this, my janky experiment consisted of attaching a small marker to a ruler to use as the gun, and a big marker to a table to mark the spawn point of plates.
One of the hardest parts was encoding user input in an AR experience since you don't have easy access to buttons, specially holding a ruler-gun in one hand and your phone in the other. In this case, the inputs are shooting the gun and reloading it. For this I focused on simple gestures that can be easily checked with tracking states: You shoot by keeping the gun in the screen, and you can reload by taking it off the screen for a moment. To aim, you use the gun orientation and sight line to point at plates.
The 3D models were also made by myself with blockbench. I recently discovered this 3D modeling app and used this opportunity to learn 3D modeling with a simple program. It was a lot of fun!
In this section I will show up some samples of the game, so you can see how it works!
As I mentioned earlier, to reload your gun, you simply need to take it off the screen for a moment. However, if you leave it off the screen for too long, it won't reload. This means that you can also save ammo. Additionally, it's important to note that the color of the highlights on the gun indicates how many shots you have left.
Reloading Example | Non-Reloading Example |
---|---|
As soon as the table marker becomes trackable, plates will spawn. Additionally, I have added a small indicator in the top right corner that will appear when the table is visible. This provides users with feedback in situations where tracking may not be optimal.
Here, we can take a closer look at my experiment with the ruler-attached marker:
When you hit a plate, it will disappear. Originally, I had intended to create a time-based game. However, during development, I found that it was more enjoyable to allow players to hit as many plates as possible without any time constraints. Therefore, I changed the game to an infinite mode instead, where players can continuously hit plates, even on the table surface.