Hello,
I have made a script which is give me error of hand list.
I am using unity 2017 and desktop.
Not using VR.
Here is code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Leap;
//using Leap.Unity;///// This one also give error
public class move_camera : MonoBehaviour {
public Controller controller;
float HandPalmPitch;
float HandPalmYaw;
float HandPalmRoll;
float HandwristRot;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
controller = new Controller ();
Frame frame = controller.Frame ();
Hand.hands = frame.Hand;
hands=frame.Hands;
List<Leap.Hand> hands = frame.Hands; ////////// This is give error
if(frame.Hands.Count>0)
{
List<Hand> hands = frame.Hands;
Hand firstHand = hands[0];
HandPalmPitch = hands [0].PalmNormal.Pitch;
HandPalmRoll =hands [0].PalmNormal.Roll;
HandPalmYaw = hands [0].PalmNormal.Yaw;
}
HandwristRot = hands [0].WristPosition.Pitch;
print ("pitch"+HandPalmPitch);
print ("roll"+HandPalmRoll);
print ("yaw"+HandPalmYaw);
//move obj
if(HandPalmYaw > -2f && HandPalmYaw < 3.5f)
{
// transform.Translate = new Vector3(0 , 0, 1 * Time.deltaTime);
}
else if(HandPalmYaw < 2.2f)
{
// transform.Translate = new Vector3 (0 , 0, -1 * Time.deltaTime);
}
}
}
Please correct me,
Thank you