Custom Kinect Gestures in Unity3D? Here's how...
- Posted: Nov 25, 2014 at 6:00AM
- 1 comment
Loading user information from Channel 9
Something went wrong getting user information from Channel 9
Loading user information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Peter Daukintis, Microsoft Technical Evangelist has been on a Kinect Unity roll recently. Today he answers a question that I've also seen asked often, custom gestures in Unity3D
Here's some of the other posts from Peter we've highlighted recently;
I have received a few questions recently about detecting Kinect custom gestures in Unity 3D and it seems that there are a few issues with getting this up and running. I have previously posted about Kinect Custom Gestures and also using ‘built-in’ gestures from the Kinect 4 Windows SDK inside Unity so it makes sense to complete the loop here. I’ll run through my experience. A few things to set up straight off the bat:
I created a new Unity project and selected to install the Visual Studio 2013 Tools Unity Package (not required but I like to debug using Visual Studio)
I imported some Unity Kinect custom packages: Assets > Import Package > Custom Package and then navigated to the Kinect Unity Package location on my local disk. (the Kinect unity package can be downloaded here http://go.microsoft.com/fwlink/?LinkID=513177). Add both the Kinect and Kinect.VisualGestureBuilder packages.
Creating the Scene
As before, in this previous post I created an empty game object and also a new c# script and added the following code to detect the Kinect sensor, pull the body data, exposing it to other scripts and also to retrieve the body tracking ID which will be required to identify the body on which we are detecting the gestures. To keep things simple I assumed only one tracked body and as always remember this is intended as a sample so I may not be as careful with cleaning up event handlers, etc.
Find the sample project here.
Other useful resources:
Another working sample – https://github.com/carmines/workshop/blob/dev/Unity/VGBSample.unitypackage
Project Information URL: http://peted.azurewebsites.net/kinect-4-windows-v2-custom-gestures-in-unity/
Project Source URL: http://1drv.ms/1uKAxK2