I'm making a game where the save and load system is going to show when I face my palm up. The problem is, I don't know how I can detect if my palm is facing up. All I know is how to get the palm distance and position.
I tried this:
using Leap;
using Leap.Unity;
public class GetPamlPositionLeap : MonoBehaviour {
LeapProvider provider;
// Use this for initialization
void Start () {
provider = FindObjectOfType<LeapProvider>() as LeapProvider;
}
// Update is called once per frame
void Update () {
Frame frame = provider.CurrentFrame;
Hand hand = frame.Hand [0]; // cannot apply indexing
Vector position = hand.PalmPosition;
Vector direction = hand.Direction;
Debug.Log ("The position of hand is" + position + "The direction of hand is" + direction);
}
}
But it returns error:
cannot apply indexing to an expression type