This guide shows you how to get started with the Tobii EyeTracking SDK for Unity 5.
In seven simple steps we will go from a empty Unity project, to having a cube that rotates when you look at it.
1. Create a new Unity project
Start by opening up Unity and select to create a new project.
Give your project a suitable name such as HelloTobiiEyeTracking.
2. Download the Tobii EyeTracking SDK for Unity 5
Leave the Unity Editor open and fire up a web browser of choice.
Now head to the Tobii Developer Zone and download the latest Tobii EyeTracking SDK for Unity 5 package.
3. Import the Tobii EyeTracking for Unity 5 package
Extract the downloaded zip file and double click the
Unity will now regain focus and ask you where to import the assets.
By clicking the Import button, Unity will import all the necessary code and dependencies to your project. (The “DemoScenes” and “Docs” folders are not needed for this tutorial.)
The project is now set up with EyeTracking functionality. Let’s try it out!
4. Add a cube
Add a cube to your scene, for example by selecting “GameObject” → “3D Object” → “Cube” in the main menu.
(If the Game view does not show anything, add a Camera, tag it as “MainCamera”, add a Directional light, and move the cube until you see it.)
5. Make the cube gaze-aware
Select the cube, go to its Inspector window and click the “Add Component” button.
Browse to the “EyeTracking” sub menu and select “Gaze Aware”.
A new component of type
GazeAware has now been added to your cube.
6. Make the cube spin
Now, add a new C# script component with a suitable name, such as “SpinOnGaze”, to the cube.
Open the newly created script and edit it to look like this:
public class SpinOnGaze : MonoBehaviour
private GazeAware _gazeAware;
_gazeAware = GetComponent<GazeAware>();
Press the Play button in the Unity Editor and enjoy the beautiful cube that rotates when you look at it.
For more examples of what you can do with the Tobii EyeTracking SDK for Unity, import the full
.unitypackage to a new Unity project and check out the demo scenes located in the Tobii/DemoScenes folder.
EDIT 2016-10-12 by Jenny [Tobii]: Updated the guide to match the Tobii EyeTracking SDK for Unity 5.