NICOLAI MUNK PETERSEN: Unity is a game engine that
works on multiple platforms.
Unity is a great way to build both 2D and 3D experiences,
and we have created a Unity package
for Project Tango and Android.
My name is Nicolai, and in this video,
I'll show you how hard-- well, actually,
how easy it is to integrate motion tracking in Unity.
Project Tango packages a set of new computer
vision-enabled features for mobile devices.
It takes the sensor readings from multiple sensors
and fuses them together on the fly.
Based on that description, you might
think that it's going to be a lot of work to integrate.
If you are new to Unity, check out the developer videos
and download the Unity development environment.
It's pretty big, so you might want to do that now.
To use this new package you need Unity, the Project Tango SDK,
and a Project Tango enabled device.
Let's get started.
Hi, [? Jared ?].
Do you mind helping us out?
[? JARED: Hi, ?] Nicolai.
Of course.
Let's do this.
To save some time, let's start with a project
that I've already built in Unity.
This project does not use Project Tango,
and we will add motion tracking to it.
Currently, I can use the keyboard and mouse
to move the camera around, and I want
to change that to use Project Tango.
To work with Unity and Project Tango,
you need the most up-to-date Unity package
from the developer website.
If you don't already have that, go ahead and get it now.
With Unity set up and updated, I'm
going to import the latest Unity package
right into my project now.
Now that the Project Tango SDK is part of my project,
I need to place the Tango Manager prefab.
You'll find this prefab, along with other Project Tango
prefabs, in the Tango Prefabs folder
at the root of your project.
Let's place it.
In the Tango Manager prefab, you're
going to choose how to use Project Tango in your scene.
I want to use motion tracking, so I
need to check Enable Motion Tracking.
You can enable other options here
for using other parts of Project Tango, such as Enable Depth,
for depth sensing, and the UX library,
for displaying the initial connection.
You can check out the documentation linked at the end
to learn more.
OK, that's it for configuring.
Now, let's replace the current camera with one
controlled by Project Tango.
We will use the Tango Delta Camera prefab.
I'll place that prefab in my scene
at the same position as the existing camera.
And then I have to disable the existing camera.
This camera is called a Delta camera
because it calculates the change of position and rotation
for the device.
The camera follows the motion of the device precisely,
but, of course, we don't want anyone walking through walls.
So, it uses the Unity character controller
to keep everybody safe.
And as an added benefit, this makes
it easy to replace cameras in existing games with the Delta
camera.
Of course, your own game may not fit
into the default shoebox, which is why you can customize
the Tango Delta camera.
For example, it is straightforward to change
the camera view to a top-down, or third person view.
Select the multi-camera child, and change the mode here
to third person, or top-down.
But let's stick with first person for now.
By default, this prefab shows a motion trail.
I can hide the trail of where I've been
by disabling this trail child.
Actually, I'm going to do that right now.
It's a cleaner look.
Finally, let's get this running on my tablet.
In order to build and run this project on my tablet,
I have to build it on Android.
So I go to the Build settings.
I'm already set up for Android.
So now I'll build and run it on my device.
It's all done.
Let's try it out.
Pretty awesome.
NICOLAI MUNK PETERSEN: Thank you, [? Jared. ?]
As you can see, it's pretty straightforward
to integrate motion tracking with your experience
to control the camera perspective.
In addition to controlling the camera,
you can use motion tracking to directly control your avatars.
Watch the user experience videos to learn
how to take full advantage of motion tracking,
avoid the pitfalls, and create stunning motion
enabled experiences.
And don't forget to visit our Google+ community and join us
on our journey.
We are excited to see what you will build a Project Tango.
[MUSIC PLAYING]