Unity Gaming: Integrating Kinect (part 2)

Kinect and Unity – Setup

Okay so in part 1 I showed you how to get the kinect working on your computer. But how do we get it in a Unity Project you ask? Oh, you didn’t, well I’ll tell you anyway. =)

First step is download the Kinect for Windows Unity Package. You can find it at this link: https://www.microsoft.com/en-us/kinectforwindows/develop/downloads-docs.aspx




To get started we will use the steps directly outlined in the Kinect for Windows Unity Package from Microsoft; but slightly edited since we already have a project created.

  1. Expand the .Zip file, and move Kinect.2.0.1410.19000.UnityPackageto a well known <location>
  2. Open UnityPro (you need to have a Pro edition to pull in custom packages and plugins)
  3. Open your Unity Project
  4. Click on the menu item Assets->Import Package->Custom Package…
  5. Navigate to the <location> from step 1
  6. Select the Kinect.2.0.1410.19000.UnityPackage
  7. Click “Open”
  8. Click “Import” in the lower right hand corner of the “Importing Package” Dialog (which Unity will launch after step 7)**Before you do step 8 here is an important thing to note – When Importing notice that the folder is called StandardAssets. This is the same name as the Sample Assets from the Unity Store. If you are using Unity’s Standard Assets package the import manager will embed the new Kinect files into the already existing folder. Be careful! If you don’t keep track of what you’re importing you might lose files within the numerous folders of your project. So, to keep things organized keep note of the files that are not in subfolders and are just in the Standard Assets folder.

    In this case there are 10:

    • EventPump.cs
    • KinectBuffer.cs
    • KinectSpecialCases.cs
    • CameraIntrinsics Import Settings
    • CollectionMap Import Settings
    • ExecptionHelper Import Settings
    • INativeWrapper Import Settings
    • NativeObject Import Settings
    • SmartGCHandle Import Settings
    • ThreadSafeDictionary Import Settings

    Okay now back to the steps**

  9. If you wish to see the Kinect in action there are two sample scenes available from the zip.
  10. If you wish to use VisualGestureBuilder within Unity, repeat steps 1 through 8 with Kinect.VisualGestureBuilder.2.0.1410.19000.unitypackage
  11. If you wish to use the Face functionality within Unity, repeat steps 1 through 8 with Kinect.Face.2.0.1410.19000.unitypackage

Okay lets stay organized. Create a new Folder in your Assets Folder called KinectPackage. Then, add the 10 files I mentioned above as well as Windows Folder from StandardAssets.




And that’s it for part 2. In part 3 I’ll show you how to track your joints and start scripting as well as get a skeleton in your project! For the Infinite Runner Game we will use the kinect to act as a controller!


Happy Coding!


Leave a Reply

Your email address will not be published. Required fields are marked *