Object Look at user (UNITY)

Hello there,
I am playing around with Nuitrack in Unity and it’s awesome!
I get all commands about picking positions of joints. But I need “real” head position to point object to look at user face. So it seems like he know where is my face and look direct at my face.

Cheers,
Joe

Hi! Getting a real head position is very easy!

 void Update()
 {
    if(NuitrackManager.Users.Current != null && NuitrackManager.Users.Current.Skeleton != null)
    {
        UserData user = NuitrackManager.Users.Current;
        UserData.SkeletonData.Joint headJoint = user.Skeleton.GetJoint(nuitrack.JointType.Head);

        Debug.Log(headJoint.Position); // in meters
    }
}

It can be made even easier! Inherit your script from TrackedUser, and redefine the Process method. Take a look at the inspector and you will see that you can easily set up tracking of the current user or user by the specified ID

using UnityEngine;
using NuitrackSDK;

public class UserHead : TrackedUser
{
    protected override void Process(UserData userData)
    {
        if(userData.Skeleton != null)
        {
            UserData.SkeletonData.Joint headJoint = userData.Skeleton.GetJoint(nuitrack.JointType.Head);
            Debug.Log(headJoint.Position); // in meters
        }
    }
}

You can also look at userData.Face. Good luck!