Hey all, I am just beginning my journey with leapmotion. And While it works great with everything else I am doing. I am having a problem getting Raycast to project. Every time I want to attach the script to my hand model it returns a null reference point. If anyone has an idea or could help me out how to be able to project those raycasts without returning null that would be great. Attached is my code:
void Start()
{
hand_model = GetComponent<HandModel>();
leap_hand = hand_model.GetLeapHand();
if (leap_hand == null) Debug.LogError("No leap_hand founded");
}
void Update()
{
for (int i = 0; i < HandModel.NUM_FINGERS;i++)
{
FingerModel finger = hand_model.fingers[i];
// draw ray from finger tips (enable Gizmos in Game window to see)
Debug.DrawRay(finger.GetTipPosition(), finger.GetRay().direction, Color.red);
}
}