C# leap motion check if hand is left or right

Hello there,

somehow I seem to miss something, because I got no problems executing code based on the position of the leftmost or rightmost hand. Unfortunately this only works when two hands are recognized. As soon as only one hand is available it is obviously the leftmost and rightmost hand :wink:

Has anyone got a complete C# script example checking if a hand is left or right and would be kind enough to share?

Leap motions Documentation states it is possible to detect if a hand is a left one or a right one. Unfortunately I can not get this to run: Downloads – Page Array – Ultraleap

if (hand.IsRight) {
// … Do right handed stuff
}

Snippet I used successfully for leftmost / rightmost data:

using UnityEngine;
using System.Collections;
using Leap;

public class LeapLogicBothHands : MonoBehaviour {
    Controller controller;
    public Vector HandRightPos;
    public Vector HandLeftRot;
    void Start ()
    {
        controller = new Controller ();
    }
   
    void Update ()
    {
        Frame frame = controller.Frame ();

        HandList hands = frame.Hands;
        Hand HandLeft = frame.Hands.Leftmost;
        Hand HandRight = frame.Hands.Rightmost;
       
        HandLeftRot = HandLeft.Direction;
        Debug.Log ("Left rot: " + HandLeftRot);
        HandRightPos = HandRight.PalmPosition;
        Debug.Log ("Right pos: " + HandRightPos);
    }
}

Thanks
Ralf

Hi did you end up figuring this out?

I’m a leap beginner and I’m trying to get leap fingertip data but I can’t figure out how to use the API and there aren’t any tutorials out there.