cancel
Showing results for 
Search instead for 
Did you mean: 

Snap Interactable Two Handed Grab Conflict

MCDopsa
Explorer

We are using Snap Interactables and Snap Interactors on objects to place them into specific locations.

This works well with a single-hand grabbable, but we need some objects to use a 2-Handed grab. When we add the 'Two Hand Free Transformer' component, and assign it to the Grabbable, grabbing works, but the socket interaction no longer works correctly;

 

1. The object does not move into the right place on Select, it stays where it was at the time of Select.

2. The object remains 'stuck' in the socket, and has a new position & rotation offset that prevents the user from pulling it out of the socket's selection.


Is there a known limitation to using 2 Handed Grab and Sockets? If so, is there a place in the documentation we can see these limitations? Otherwise, any suggestions on how we can approach this interaction?

4 REPLIES 4

MCDopsa
Explorer

@Big_FlexI saw you asking for tags for Interaction SDK questions, hope it's ok to do so here!

Hi @MCDopsa, I really appreciate you tagging me! I've made a task to investigate this. I'll also ask the rest of the team. I'll follow up here once I have a solution for you 🙂  

Big_Flex
Expert Protege

@MCDopsa I have a solution for you. The issue is that when you grab an object with both hands, the snap interactor is also still selecting, which prevents the object from snapping. So to fix that, you need to disable the snap interactor whenever you're grabbing the object, then re-enable the snap interactor whenever you release the object.

Here's how you can do that. I'll use one of the Moon GameObjects from the SnapExamples scene as an example.

  1. On the Moon GameObject, add a GrabFreeTransformer component, which has replaced both OneGrabFreeTransformer and TwoGrabFreeTransformer.  You can read more about that component in the "GrabFreeTransformer" subsection of the Grabbable doc.
    Big_Flex_1-1712262413533.png
  2. In the Grabbable component, uncheck Transfer on Second Selection, since you want to grab with two hands.
    Big_Flex_2-1712262536825.png
  3. Set the One Grab Transformer and Two Grab Transformer fields to the Grab Free Transformer component.
    Big_Flex_3-1712262607826.png
  4. In the Interactable Group View component, set Element 0 to the HandGrabInteractable component of one hand.
    Big_Flex_4-1712262767216.png
  5. Set Element 1 to the HandGrabInteractable component of the other hand.
    Big_Flex_5-1712262832903.png
  6. Under Inspector, add an Interactable Unity Event Wrapper component, which will handle toggling the snap interactor.
    Big_Flex_6-1712262954142.png
  7. In the Interactable Unity Event Wrapper component, set the Interactable View field to the Interactable Group View component.
    Big_Flex_7-1712263043146.png
  8. In the When Select() method, add a new element and set it to the Snap Interactor GameObject's Disable method. This will disable the snap interactor if you grab the object.
    Big_Flex_8-1712263132982.png
  9. In the When Unselect() method, add a new element and set it to the Snap Interactor GameObject's Enable method. This will enable the snap interactor if you release the object.
    Big_Flex_9-1712263200532.png

     

 

Thank you @Big_Flex for this investigation and great explanation of how to circumvent the issue! I really appreciate the time you put in and the clarity of your response. Testing it, it's great to see that the OnHover callback is still respected while the Snap Interactor is 'Disabled' as I was worried this would not be the case. Much appreciated!

One issue we're still running into, is trying to force Two-Handed grabs exclusively. We were originally using the older 'TwoGrabFreeTransform' because we wanted to handle two-handed grabs only, while ignoring one-handed grabs.

 

In this image, I tried clearing the OneGrabTransformer slot, keeping only the TwoGrabTransformer slot filled. This does prevent One-Handed grabs from starting a transformation, but results in the same Snap Interactor issue from before, where upon unselecting, the object remains in place.

MCDopsa_0-1712591524503.png


Is there a way to exclusively support Two-Handed grabs, while preserving the Snap Interaction?

Thank you!