Leap Motion & Oculus : Draw Line between points( Hands)

I’m trying to draw a line between the palm position of two hands( Leap).
Im trying to use OnDrawGizmos but for some reason I don’t see the line.
My code:

    void Update () {



        HandController handController = HMHC.transform.GetComponent<HandController>();
        HandModel[] hands = handController.GetAllGraphicsHands();
      
        leftValid = false;
        rightValid = false;
      
        foreach(HandModel hand in hands)
        {
            Hand leapHand = hand.GetLeapHand();
            if (leapHand.IsRight)
            {
                rightH = hand;
                rightValid = true;
            }
            else if (leapHand.IsLeft)
            {
                leftH = hand;
                leftValid = true;
            }
        }
        if(leftValid && rightValid){
            leftP=leftH.GetPalmPosition();
            rightP=rightH.GetPalmPosition();

        }


  
    }


    void OnDrawGizmos() {
        if(leftValid && rightValid){
            Debug.Log("IT WORKSSSS");
            Gizmos.color=Color.red;
            Gizmos.DrawLine(leftP,rightP);

If I understand correctly, the OnDrawGizmos gets called every frame. My debug statement does print, but I don’t understand why I can’t see the line.

Thanks!

Update: Now that I look at the documentation closely I think that the Gizmo is not the best way to approach this.: What I need is a Line that is seen in the game view.

Pick your poison: LineRenderer or GL.Lines

Hi,

We use Line Renderer for that.
In our Starter Kit we draw a line between two index fingers.
What is more - we do this only when both fingers are straight.

This is our youtube video:

Asset available here: Unity Asset Store - The Best Assets for Game Making

For any further questions feel free to contact us at info.brsoft@gmail.com

I have a trouble when import the latest Leap motion into Unity Pro 5.1.2 on window 7 64 bit with the error alert “Open file not found LeapCSharp.NET3.5.dll” even though it is there. Has you solved that issue?

Move all of the Leap assets to the root folder, maybe? Instead of that /plugins/ crap.

https://developer.leapmotion.com/getting-started/unity/free