kinect wrapper package

hey,

I am trying to use kinect wrapper package http://wiki.etc.cmu.edu/unity3d/index.php/Microsoft_Kinect_-_Microsoft_SDK

but i have an error that it can’t find MSRKINECTNUI.DLL even that i gave it the path to MSRKINECTNUI.lib

Does anyone know how to fix this?

Hi,

After you installed the SDK 1.5 of Kinect for Windows, you need to change a path that is programed in the KinectInterop.cs file from the pakage wrapper. This file is in the Kinect folder of your scene in Unity.

KinectInterop.cs (from line 310 to 345 line)

wrong path -
“C:\Program Files (x86)\Microsoft Research KinectSDK\MSRKINECTNUI.DLL”

new path -
“C:\Windows\System32\Kinect10.dll”

By the way, i found a bug in the unity when i run the kinect with unity (i asked already - http://answers.unity3d.com/questions/246978/kinect-and-unity-error-at-play.html) if you experiment this error too, the solution is, in the same file (KinectInterop.cs) you have to create a callback function and implemet it in KinectSensor.cs file.

kinectInterop.cs

//create a struct
public struct NuiStausProc
{

}

//In the NativeMethods method (line 346 aprox.) at th end add the next commands
[DllImportAttribute(@"C:\Windows\System32\Kinect10.dll", EntryPoint = "NuiSetDeviceStatusCallback")]
public static extern void NuiSetDeviceStatusCallback(NuiStatusProc callback);

Then, in the KinectSensor.cs file put the next line before the catch instruction inside th Awake function (line 139 aprox.)

NativeMethods.NuiSetDeviceStatusCallback(new NuiStatusProc());}
catch (Exception e)...

With those changes you can solve this bug.

I hope this works for you. I’m so sorry for the spelling, BTW and hope it’s easy of understand.

happy programming

hi guys.

I just made that and now I’m getting an error:

NuiInitialize Failed.
UnityEngine.Debug:Log(Object)
KinectSensor:Awake() (at Assets/Kinect/KinectSensor.cs:145)

Any idea? thanks

ArturitoMys is correct. Just switch the path and you should be alright. I’ve gotten by without the callback, however.

This wrapper package works in Indie and Pro versions of Unity.