Forum Discussion
DirtyLeon
3 years agoHonored Guest
How to hide hand while grabbing an object using the Oculus Interaction SDK?
Hello. I'm using the Oculus Interaction SDK to create some puzzle solving game.
How to hide the hand that's currently grabbing an object? For now I can only create grabbing pose with HandGrabInteractable component, but what I need is to hide the hand when I grab on certain objects.
Also, can a object know which hand it is being grabbed with?
2 Replies
Replies have been turned off for this discussion
- FahruzExpert Protege
Disable the renderer?
To know which hand grabbed the object, see this solution.
- RehesProtege
Hi,
So far what I have researched about your issue I gotta know that either you can use the HandGrabInteractable component's HideHandVisualsOnGrab property to hide the hand when the object is grabbed. To do this, simply set the HideHandVisualsOnGrab property to true on the HandGrabInteractable component of the object you want to hide the hand for.Or, you can also use a custom script to hide the hand when the object is grabbed. To do this, you will need to create a script that subscribes to the OVRHandGrabInteractable.GrabBegin and OVRHandGrabInteractable.GrabEnd events. When the GrabBegin event is fired, you can hide the hand. When the GrabEnd event is fired, you can show the hand.
And if you wann know which hand is grabbing us the OVRHandGrabInteractable component has a Hand property that you can use to get the hand that is currently grabbing the object. The Hand property will be null if no hand is grabbing the object.
Let’s say:
{ private OVRHandGrabInteractable handGrabInteractable; private GameObject handVisuals; void Awake() { handGrabInteractable = GetComponent<OVRHandGrabInteractable>(); handVisuals = GameObject.Find("HandVisuals"); } void OnEnable() { handGrabInteractable.GrabBegin += OnGrabBegin; handGrabInteractable.GrabEnd += OnGrabEnd; } void OnDisable() { handGrabInteractable.GrabBegin -= OnGrabBegin; handGrabInteractable.GrabEnd -= OnGrabEnd; } void OnGrabBegin() { handVisuals.SetActive(false); } void OnGrabEnd() { handVisuals.SetActive(true); } }
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 4 years ago