Hello,
I am not sure whether it is the right place to ask for this but I don't know whereelse to go and I hope someone will be able to help me here :-).
I do not understand why Hand.isValid ALWAYS returns false. However, the data that I access about my hands (position of fingers, angles between bones) are correct. Except when I tried to use SphereCenter, it did not show the right place. So I debug and then I realize my "tracking data" is always invalid and I don't understand why ... I tried two different ways :
First try
using UnityEngine;
using System.Collections;
using Leap;
public class myClass: MonoBehaviour {
HandModel hand_model;
Hand leap_hand;
void Start () {
hand_model = GetComponent<RigidHand>();
}
void Update() {
leap_hand = hand_model.GetLeapHand();
if (leap_hand != null)
{
if (leap_hand.IsValid)
print("valid");
else
print("not valid");
}
}
`
this one always print not valid even though I see my hand being tracked and i can access positions of fingers..etc.
Second try with the controller object
using UnityEngine;
using System.Collections;
using Leap;
public class myClass: MonoBehaviour {
private Controller controller;
void Start () {
controller = new Controller();
}
void Update() {
Frame frame = controller.Frame();
HandList hands = frame.Hands;
if (hands == null)
print("hands null");
else if (hands.Count == 0)
print("0 hands");
else
{
print(hands.Frontmost); // always print invalid hand
leap_hand = hands.Frontmost;
}
}
same result, it always prints invalid hand for hands.Frontmost or hands[0].
I have the Orion Beta version by the way.
Thank you for your help !!