Contrary to what I've said in the last message, the bug is still present also in the last version of the package.
These my steps to solve:
- Create two children, one of CapsuleHand_R and one for CapsuleHand_L.
- Add a PinchDetector component to them.
- Edit the beginning of the script in this way:
public class PinchDetector : Detector {
enum handSide { RIGHT, LEFT };
[SerializeField]
private LeapProvider lp;
[SerializeField]
private handSide hs;
- Edit the ensurePinchInfoUpToDate function in this way, just after _didChange = false;
.
if (lp.CurrentFrame.Hands.Count == 0)
return;
//Hand hand = _handModel.GetLeapHand();
var hands = lp.CurrentFrame.Hands;
Hand hand = null;
foreach (Hand h in hands) {
handSide s = (h.IsRight) ? handSide.RIGHT : handSide.LEFT;
if (s == hs) {
hand = h;
break;
}
}
- Drag the LeapServiceProvider component to the inspector and choose the hand side.
- Add LeapRTS to your object and drag the modified LeapPinchDetector.
Here the result: