Here's a script that shows how to access the positions of the Leap hands.
Step 1. Attach it to a gameObject
Step 2. Drag the transforms containing the IHandModel components on the Inspector fields
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Leap.Unity;
public class HandPositionReporter : MonoBehaviour {
//drag transforms containing IHandModel componenents to these Inspector fields
public IHandModel Hand_Left;
public IHandModel Hand_Right;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update() {
if (Hand_Left.IsTracked) {
Debug.Log("Left Palm Position: " + Hand_Left.GetLeapHand().PalmPosition.ToVector3());
}
if (Hand_Right.IsTracked) {
Debug.Log("Right Palm Position: " + Hand_Right.GetLeapHand().PalmPosition.ToVector3());
}
}
}