The Intel® RealSense™ SDK has been discontinued. No ongoing support or updates will be available.

This guide will help you use the Intel® RealSense™ Unity* Toolkit from the Intel® RealSense™ SDK to integrate Intel RealSense technology into your projects. This guide assumes you have installed a supported version of Unity, the latest version of the Intel RealSense SDK, and imported the Intel RealSense Unity Toolkit into your development environment. The guide for importing the toolkit into Unity can be found in this guide’s companion tutorial, “8 Steps to Add Intel RealSense Unity Toolkit to your Project”.

Create Simple Game Objects 1. We will begin this example with a new project then, in the Hierarchy screen, click on the Create button and then select Cube. This adds a Cube game object to the Scene. 2. In the Hierarchy screen, click on the Create button and then select Directional Light . This adds a light source to the Scene. 3. In the Assets screen, expand the RSUnityToolkit folder and then the Actions folder by double-clicking the folder icons. 4. The Actions folder contains a number of scripts that can be applied to game objects. Click on the TrackingAction script, then drag and drop it on the Cube game object in the Hierarchy screen 5. Now, select Cube in the Hierarchy screen and verify Tracking Action (Script) is shown in the Inspector screen. Configure Hand Tracking 6. By default, Tracking Action is set to HandTracking and the Virtual World Box Dimensions are set to 100 for X, Y and Z. If you play the game at this point you will see the 3D depth camera’s LED turn on, indicating the camera has been activated. 7. If you raise your hand in front of the camera you will likely see the Cube game object shoot off the screen. This is because the Virtual World Box Dimensions are set so high. Change the Virtual World Box Dimensions to 10 for X, Y and Z. 8. I n the Scene view you will observe that the Virtual World Box, shown in red outlines, is now more constrained around the game object. 9. R un the game again. The Cube game object should now track your hand more closely within a more confined virtual space. 10. O ne thing you might notice is that the movement of the Cube game object is somewhat jittery. This can be smoothed by increasing the Smoothing Factor to 10 (from default 0) . Configure Face Tracking 11. The Cube game object can easily be changed to track the user’s face. Locate Tracking Action in the Inspector window and change the default from HandTracking to FaceTracking. 12. Run the game and ensure your face is within the field of view of the camera. The movement of the game object should now track your face and rotate based on the user’s head orientation (roll, pitch and yaw).

You have now added Intel™ RealSense™ to your Unity project. Congratulations! Now get back to work and make a great game.

Links:

Unity* Trial Download