Hi guys i just want to ask if how can i move my prefab leap motion position by 1 when the two hand is detected in unity so far i've this.
using UnityEngine;
using System.Collections.Generic;
using Leap;
using Leap.Unity;
public class Swimming : MonoBehaviour {
LeapProvider provider;
//this is for the camera
[SerializeField]
Transform thisCamera;
void Start ()
{
provider = FindObjectOfType<LeapProvider>() as LeapProvider;
}
void Update ()
{
Frame frame = provider.CurrentFrame;
foreach (Hand hand in frame.Hands)
{
if (frame.Hands.Count > 1) {
thisCamera.transform.Translate (Vector3.forward);
}
}
}
}
the problem with this code is that . the longer the hand in the leap motion it continuously move.
i want it more likely swim. anyone help me please. just need this badly . Trying for 3 days already