Unity How-to Guide: Simple Augmented Reality

This tutorial will get you up and running with a simple Augmented Reality application in Unity. The instructions are intended for Unity developers of any experience level. You will add a gameObject to a scene, and then you'll view the gameObject in your surrounding environment as seen through your device's camera lens.

Preliminary steps

  1. If you haven't set up your computer to develop with Tango in Unity yet, see Getting Started With Unity.

  2. Go to the Setup for All Unity Tango Apps page and perform the basic setup operations on that page. When you have finished, return to this page and continue on with the steps below.

Configure the Tango Manager

In the Hierarchy panel, select Tango Manager, and then in the Inspector panel, make sure the following options are selected:

  • Auto-connect to Service.
  • Enable Motion Tracking with Auto Reset.
  • Auto Reset.
  • Enable Video Overlay with Method = Texture and Raw Bytes.

Add the Tango Camera

  1. In the Project view under Assets, click the TangoPrefabs folder to display its items.
  2. Drag Tango Camera into the Hierarchy view.

Add and move a sphere

  1. On the GameObject menu, point to 3D Object, and then select Sphere.
  2. In the Transform section of the Inspector, change the Z value for the sphere's position to 2.
  3. Click the Game tab. The view should look like this:

    When you are finished viewing, click the Scene tab.

Build and run your project

  1. On the File menu, click Build and Run.
  2. In the Build Settings dialog, click Build and Run.
  3. In the Build Android dialog, enter a name in the Save As field, and then click Save.

Enviar comentarios sobre…