Hi,
You can do this in a couple of ways.
Use the HandController prefab from our Unity asset package, but assign the DebugHand assets to the controller rather than one of the visual hand prefabs. The benefits here are that the HandController script automatically gets the tracking data and convert it into the Unity coordinate system. Also, you can orient the controller object anyway you want and the tracking data coordinates are also transformed accordingly. You can even attach the HandController prefab to a character controller and all the coordinates are transformed to be relative to your character. When you use the Debug hands prefab, the hands are only displayed in the Scene view, not the game view -- this can make it easier to see what the in game hands are doing when you are designing or debugging an interaction.
-
Just create a Controller object in code and get the tracking data yourself. This will give you the tracking data in the Leap Motion coordinate system. This is a simple as:
using UnityEngine;
using System.Collections;
using Leap;
public class TrackingDataSource : MonoBehaviour {
// Leap Controller is a singleton at heart
Controller controller = new Controller();
//Use polling to get frames at Unity frame rate
void Update () {
Frame frame = controller.Frame ();
// use the data...
}
}
We have additional documentation on our dev portal: https://developer.leapmotion.com/documentation/unity/index.html
(If you aren't using the assets, then most of the documentation under C# applies as well.)