How to program for Kinect?

Exactly what the title says. But more specifically, how can you record Kinect motion and create a margin of error for picking up that motion? How could I use that motion to trigger an event in my game? Maybe I just don’t completely understand how the Kinect and UE4 work. Can someone explain this to me?

Thanks!
-Jack

Did you check this?