4

*I've been working on a project in unity3D using a kinect set-up. The set up is working perfectly. I'm using Unity3D 3.4 in combination with OpenNI, C# coding and of course a kinect.

The issue I'm facing is that the standard playermanager of openNI isn't sufficient as it doesn't recognize a player leaving without a timeout first. The matter is, I am trying to find out which event is triggered the moment a player is out of sight.

Normally when a player steps out of the frame, the software will start counting, and only after (in my case) 20-30 seconds it will release the actual player.

A long story short, I need to know what event is triggered the moment a player isn't visible any more. OR I would love a solution on how to know at any given time how many active players are in the field of view.

Thank you very much in advance!*

The solution:

private void ExitUserCallback(object sender, UserExitEventArgs e)
    {
        // Put whatever code you want active when player leaves field of view
        Debug.Log("Exit user, userID=" + e.ID);
    }
  • 3
    Next time you'd better write what library you use to work with Kinect from Unity since it doesn't have native Kinect support. And it's hard to tell you what's happening when we don't know what code you use. – Valentin Simonov Oct 22 '12 at 21:11
  • Is the code you posted actually the solution to your problem, or is that an example of the solution you are seeking? – Nicholas Pappas Dec 08 '12 at 14:55
  • Isn't there an event that checks if the kinect DOES see the player? – phxvyper Dec 11 '12 at 03:45
  • @EvilClosetMonkey I think thats the solution hes working in on unity3d. – phxvyper Dec 11 '12 at 17:31
  • Sorry for the late reply. This actually was my solution, for some reason (probably faulty coding of my own) this event didn't work. Now it does. The library I was working with is CL-NUI and OpenNI – Chris van Schayk Feb 03 '13 at 12:04
  • 2
    If that solves your problem, please make it an answer and accept it. You are allowed and encouraged to do so. Then this question won't show up any more as unanswered. – Bart Feb 23 '13 at 12:10

1 Answers1

0

The answer, as written in the main Question:

private void ExitUserCallback(object sender, UserExitEventArgs e)
    {
        // Put whatever code you want active when player leaves field of view
        Debug.Log("Exit user, userID=" + e.ID);
    }

Thanks for all the help ;)