TANKS! AR

Adapting the game TANKS! to AR

Augmented Reality (AR) has become a fascinating manifestation of the fusion between the digital and the real world.

An adaptation of the video game Tanks! from Unite Training Day 2015 to AR has been made.

AR Foundation in Unity has been used for this purpose, leveraging the native AR SDK of the platform. Unity also supports the Google ARCore XR Plug-in on Android.

In an augmented reality scene using AR foundation, we need to include an AR Session (in XR -> AR Session) and an AR Session Origin (in XR -> AR Session Origin).

The function of the AR Session is to maintain the AR components within the application, with this we can pause, reset or reactivate the AR elements of the mobile phone.

AR Session Origin enables the positioning of the device in the world and transforms real-world elements into the unity scene. When we move in the real world, the unity scene starts to move the AR Camera.

img

We have some other tools from AR Foundation like:

  • The AR Plane Manager which detects the planes in the real world and generates them in the unity scene.
  • AR Point Cloud Manager detects points that confrom a cloud of points, they are intended to detect important spots in the world and adjust the position of the device.
  • The MakeAppearOnPlane Script lets you instantiate a Prefab Object on the scene in a specific plane.

We will use all the level art of the game to be instantiated by MakeAppearOnPlane script.

img

Sliders are also added to the interface allowing to rotate and scale the game level.

img

Some inputs have been added to work on Android mobiles. We will use them to move and shoot with the tank.

img

Here are some screenshots:

img

img

img