Hi. I am trying to make a Roll a ball clone using the Leap Motion and Unity. The gameboard tilts side to side with one hand and back/forwards with the other. Is there a good way to do this so that it can all be controlled with one hand as using two is very cumbersome. I'm really new to LM and C# so any help with this would be amazing. I have tried googling for hours but my lack of experience and general paucity of info out there is a barrier for me.
Also, my roling ball sometimes falls through the floor but that is due to the jerky nature of the functionality I have implemented
My code that tilts the game board:
using UnityEngine;
using System.Collections;
using Leap;
public class BoardLeapManager : MonoBehaviour {
Controller controller;
void Start ()
{
controller = new Controller ();
}
void Update ()
{
//Associate the Controller with every frame
Frame frame = controller.Frame ();
//Declare hands
Hand rightMost = frame.Hands.Rightmost;
Hand leftMost = frame.Hands.Leftmost;
//Hand mainHand;
//mainHand = frame.Hands.Frontmost;
if (rightMost.IsRight)
transform.rotation = Quaternion.Euler (0, 0, rightMost.PalmNormal.Roll * 2);
if (leftMost.IsLeft)
transform.rotation = Quaternion.Euler (leftMost.PalmNormal.Roll * 2, 0, 0);
}
}