cancel
Showing results for 
Search instead for 
Did you mean: 

[Hands Tracking] Interactable tools not working with custom hands

hotlabs.tech
Explorer

I'm using the Oculus Hands demo scene for hands tracking (HandsInteractionTrainScene) and it works correctly. However when I try to replace the default hands with custom hands following the process :

  • Disable left OVRHandPrefab 
  • Disable right OVRHandPrefab 
  • Disable Left OVRControllerPrefab 
  • Disable Right OVRControllerPrefab
  • Add OVRCustomHandPrefab_L OVRCustomHandPrefab_R
  • Replace in HandsManager the default references to left and right hands prefab with the new OVRCustomHandPrefab_L & OVRCustomHandPrefab_R

I can see the custom hands working fine but the FingerTipPokeTools and the RayTool do not appear and therefore I cannot interact with the Buttons or other interactables in the scene. 😡


What am I missing? Please refer to the screenshots for additional details 


Screenshot 2022-01-05 at 18.39.49.pngScreenshot 2022-01-05 at 18.47.30.pngScreenshot 2022-01-05 at 18.47.37.pngScreenshot 2022-01-05 at 18.47.59.png

1 REPLY 1

hotlabs.tech
Explorer

After several hours of painful debugging I might have found what's the problem:


Cause

  • custom hands prefabs don’t have a OVRMesh component like the defaults hands prefab
  • this makes the HandsManager.cs:IsInitialized() method return false
  • this makes the InteractibleToolsCreator.cs: AttachToolsToHands() hang in an infinite loop

Solution

Access the HandsManager.cs script and add a public variable:

 

[SerializeField] bool _useCustomHands;

 

Then update the IsInizialised() method at line 248:

 

public bool IsInitialized () {
if (_useCustomHands) {
     return LeftHandSkeleton && LeftHandSkeleton.IsInitialized &&
     RightHandSkeleton && RightHandSkeleton.IsInitialized;
}
return LeftHandSkeleton && LeftHandSkeleton.IsInitialized &&
    RightHandSkeleton && RightHandSkeleton.IsInitialized &&
    LeftHandMesh && LeftHandMesh.IsInitialized &&
    RightHandMesh && RightHandMesh.IsInitialized;
}

 


Please let me know if you find an easier solution. In any case, I hope this will save some time for other people experiencing the same issue.