public bool CheckHit() { successfulHit = false; //Left hand raycasting if (leftHand.isActiveAndEnabled == true) { //Raycast from left hand and check for a hit hit = leftHand.GetComponent <GetLeapFingers>().RaycastFromPalm(rayCastDistance, Utility.Handedness.Left, out palmIsDownLeft, out rayIsEmpty); //hit = leftHand.GetComponent<GetLeapFingers>().RaycastFromFinger(rayCastDistance, out rayIsEmpty); //Check that a valid raycast was returned if (rayIsEmpty != true) { //Check for valid collision if (hit.collider != null) { //Debug.Log("Left hand raycast hit."); CollisionObjectLeft = hit.collider.gameObject; HitDistanceLeft = hit.distance; //return true; successfulHit = true; } } } //Right hand raycasting if (rightHand.isActiveAndEnabled == true) { //Raycast from left hand and check for a hit hit = rightHand.GetComponent <GetLeapFingers>().RaycastFromPalm(rayCastDistance, Utility.Handedness.Right, out palmIsDownRight, out rayIsEmpty); //hit = rightHand.GetComponent<GetLeapFingers>().RaycastFromFinger(rayCastDistance, out rayIsEmpty); //Check that a valid raycast was returned if (rayIsEmpty != true) { //Check for valid collision if (hit.collider != null) { //Debug.Log("Right hand raycast hit."); CollisionObjectRight = hit.collider.gameObject; HitDistanceRight = hit.distance; //return true; successfulHit = true; } } } return(successfulHit); }