For a project I want to create a VR environment using Leap Motion in which objects can be picked up. So far picking up an object is working (using the InteractionEngine module from Leap and the InteractionBehaviour script), but the objects are dropped a lot because the Leap Motion apparently thinks that the hand is letting go of the object. For the purpose that I want to use it for, it would be sufficient to stick the object to the hand once it's been grasped, sort of like sticky fingers. Can anyone help me with this? I'm very new to Leap Motion and have no idea where to start.
I've tried to use OnCollisionEnter (I have no idea whether this is a good place to start tough) but it doesn't seem to register a collision when the hand touches the object. It only sees a collision when the object falls to the ground.
Edit: More info about the environment + what I've tried with OnCollisionEnter:
This is the environment that I have right now
These are the important components of the object. (ResetFood is a small script I wrote to reset the cube to its original position and doesn't really matter for this).
This is the script in which I've tried to use OnCollisionEnter.
using System.Collections.Generic;
using UnityEngine;
public class StickToHand : MonoBehaviour
{
private void OnCollisionEnter(Collision collision) {
Debug.Log("Collision detected");
}
}
Which only prints Collision detected when the object falls on the ground.