Skip to main content

The Azure Kinect SDK received a major update a few days ago. The update introduced great new features, such as support for non-NVIDIA graphics cards. However, it came with a major issue: as people reported in Microsoft’s Kinect repository, it does not work with Unity3D any longer. That’s sad news for the majority of the Kinect developers out there. Thankfully for you, though, I’ve got the solution. Follow this tutorial to make Kinect compatible with Unity3D again.

Of course, if you want to automate the process and have a plug-and-play solution, consider our Asset Store Kinect plugin. Otherwise, read on to learn exactly how to use Azure Kinect with Unity3D

What’s the problem?

Simply put: up until version 1.4.1 of the Azure Kinect Body Tracking SDK, all you needed to do was drag and drop the C++ binary files from the SDK installation folder into your Unity project. Since version 1.4.1, that approach no longer works. You can’t debug Kinect apps in the Unity Editor and you can’t build Windows executables. Why? Microsoft has introduced a lot of new C++ DLL files to make the SDK compatible with a broad range of graphics cards. Those DLLs have conflicts with DLLs used by Unity3D. To overcome the problem, we need to copy the SDK binaries to various locations.

By the way…

Azure Kinect is out of stock. Would you like to try a commercial Body Tracking SDK that runs on Webcams, RealSense, and Apple iOS cameras, instead? Check the new LightBuzz Body Tracking SDK today.

Configuration

To run Azure Kinect in Unity3D, you need the following:

Fix!

You’ve got everything set up and working? Great! Let’s move to the actual fix. First, we’ll collect the required C# and C++ binaries. Then, we’ll make it work in the Editor, and then we’ll ensure it’s gonna work as a Windows build.

Collecting the binaries

First, you need to collect the required binary files. Here’s where to find them:

The required DLL binaries are located in the following folders:

  • C:\Program Files\Azure Kinect Body Tracking SDK\tools
  • C:\Program Files\Azure Kinect Body Tracking SDK\sdk\netstandard2.0\release
  • C:\Program Files\Azure Kinect SDK v1.4.1\sdk\netstandard2.0\release

Copy all of the .dll and .onnx files from the above locations and move to the next step. You should have 21 .dll files and 2 .onnx files. That’s right: 23 files in total.

Playing in the Editor

To run Azure Kinect apps in the Editor, you need to paste the above files next to your Assets project folder. Do not place them inside the Plugins/x86_64 folder. That’s not gonna work. Here’s how my project folder looks like:

Azure Kinect Unity3D - Fix Editor

Modifying the Unity installation folder

That’s the tricky part now. You should manually copy the DirectML.dll file into the installation folder of Unity. In my case, it is C:\Program Files\Unity\Hub\Editor\2020.3.0f1\Editor.

Azure Kinect Unity3D - Fix Installation

It’s recommended to reboot your computer after this step!

Building your project

The above method will make Kinect work in the Editor. After you build and export your program as a Windows executable, you also need to copy the DLL files next to your .exe file.

Remember to set the Build Architecture to x86_64.

Azure Kinect Unity3D - Fix Build

Summary

Made it to this point? Congratulations! You can now run the latest Azure Kinect SDK in Unity3D. It’s a cumbersome process, but it’s totally worth it. Again, if you want to avoid the hustle, just download our Asset Store Kinect plugin that automates the process for you. It’s really plug-and-play.

‘Til the next time, keep Kinecting!

Before you go…

Azure Kinect is out of stock. Would you like to try a commercial Body Tracking SDK that runs on Webcams, RealSense, and Apple iOS cameras, instead? Check the new LightBuzz Body Tracking SDK today.

Sharing is caring!

If you liked this article, remember to share it on social media, so you can help other developers, too! Also, let me know your thoughts in the comments below. ‘Til the next time… keep coding!

Vangos Pterneas

Vangos Pterneas is a software engineer, book author, and award-winning Microsoft Most Valuable Professional (2014-2019). Since 2012, Vangos has been helping Fortune-500 companies and ambitious startups create demanding motion-tracking applications. He's obsessed with analyzing and modeling every aspect of human motion using AI and Maths. Vangos shares his passion by regularly publishing articles and open-source projects to help and inspire fellow developers.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.