Unity Gaming: Integrating Kinect (part 1)

Okkie Dokkie. So the next few posts will be about how to get a kinect working in Unity! This is will eventually be integrated into the Infinite Runner game that the Unity Gaming series is about. However this will be a mini series inside of that since the process is kinda confusing, especially if it’s your first time using the Kinect. So let’s get started!

Software Setup

Now before you start just plugging in any Kinect from random Xbox One or Xbox 360, you need the appropriate software so your computer knows what you’re plugging into it. You also can’t use any rando Kinect. This tutorial uses the Kinect v2; that’s the one that is shipped with the Xbox One. However, in order to use the v2 with your computer you need to make sure you have the Windows adapter!

First let’s install the SDK. We need to go here:

https://www.microsoft.com/en-us/kinectforwindows/develop/downloads-docs.aspx

You can also go to the Kinect for Windows main site and go to their Technical documentation and tools. On the Technical Documentation and Tools page they have a list of useful links for documentation and essential downloads, including the Unity Plugin that we will also need.

DownladsPage UnityProSDKdownload

 

After you download the SDK, run it. You will be prompted with a Kinect for Windows Setup wizard.

 

SDKDownload

After you install the SDK you should have some new programs installed on your computer.

  • SDK Browser
  • Kinect Studio v 2.0
  • Kinect Gesture Builder

 

KinectNewSoftware KinectNewSoftware2

 

The SDK Browser will be the most useful of the new software, because it contains links to all the other programs/software as well as demos and example code you can use.

Hardware Setup

Setting up the hardware is pretty straight forward, which is great!

**Mac users** you will not be able to work with the Kinect unless you have Bootcamp installed (or some other way to partition your hard drive) with a windows OS, sorry.

KinectHardwareSetup

If you need more help setting up the hardware here is a helpful guide from Microsoft: https://www.microsoft.com/en-us/kinectforwindows/purchase/sensor_setup.aspx

Once you Plug in the Kinect to the USB3 port on your computer we can test the connection with the Kinect SDK applications that were automatically downloaded.

Open the SDK Browser for Kinect. The first program in the list should be the Kinect Configuration Verifier. Run it. The Kinect’s light should now turn on if it’s connected properly and the Verifier will open a window, if everything is correct, it should look like this:

KinectHardwareVerifier2

 

If something is wrong you will get a red X identifying the error:

KinectHardwareVerifier

 

Even though I have a warning about my USB port, my Kinect still runs. Now to see the information collected by the Kinect we will run Kinect Studio. It will be the third item in the SDK browser; or you can open it straight from your applications.

Kinect Studio looks like this:

KinectStudio

 

Don’t worry if you don’t see anything. At startup. Although your Kinect is on and streaming data to your computer Kinect Studio isn’t reading in that data yet.

You need to hit the plug icon at the top left hand corner so you can see anything.

KinectStudioConnected

KinectStudioConnected3

There are 7 streams of data coming from the Kinect:

  • Body Frame
  • Body index
  • Calibration Data
  • Depth
  • IR
  • Title Audio
  • Uncompressed Color

You can toggle what streams of information you want to receive by deselecting the check boxes on the left. The most important streams of data are the Body Frame/Body Index, Depth, and Infra Red (IR).

You can close Kinect Studio we don’t need it anymore. And we are done with Part 1! There are a bunch of other cool examples you can take a look at in the Kinect SDK Browser. Part 2 coming soon.

 

Happy Coding!

-TheNappingKat

 


One thought on “Unity Gaming: Integrating Kinect (part 1)”

Leave a Reply

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