Forum Discussion
Hi Lanzelot01, to snap a grabbed object to a socket, you can follow this snap tutorial. To have the controller driven hands follow the snapped object, you can use the ghost reticle tutorial. In that tutorial, you'll want to follow the instructions at the top and then jump to the section called "Option D : Create Ghost Hand Reticle".
Interaction SDK also has a large amount of sample scenes that you can discover here.
- Lanzelot1082 years agoExplorer
Hi Big_Flex
Thank you for your quick respond. I had already split the problem into two parts, namely snapping and somehow moving the controller/controller hands.
I am able to snap grabbed objects using GrabInteractor and GrabInteractable. The problem is that all the docs and samples only consider snapping AFTER grabbing. What I need is snapping WHILE holding the object.
How do I get a object snapped in the hovering state? The object should snap as the controller moves over the snap zone. As the controller moves out of the snap zone (and the user still keeps holding the grab button), the object should unsnap and follow the controller movement again.
- TeAiris6 months agoHonored Guest
I know its been a while, but you probably could use force select method in the Hand Grab Interactor for this and use colliders to trigger a force select (grab) for your target object. In your logic you would do something like this:
On collision(or trigger) enter
ForceRelease
ForceSelect (hand grab interactor component reference)
- ria_sikla6 months agoHonored GuestHi Big_Flex and communityI’m facing a similar issue in my project. I’m developing a game for violin learning on Oculus Quest 3 using Meta’s Interaction SDK with hand tracking (no controllers).I’ve set up HandGrabInteractor and HandGrabInteractable to grab a bow and make it snap to a string. However, once the bow snaps:1)The hand stops following the bow and stays in place.2)I cannot move the bow along the string while still holding it.3)If I move my hand too far, the bow should unsnap, but I’m unsure how to handle this properly.I've checked the SnapInteractor and SnapInteractable documentation, but I couldn’t find an out-of-the-box solution. The Ghost Reticle tutorial doesn’t seem to address this issue either.Is there a built-in way in the Interaction SDK to achieve this without modifying the code?If not, what’s the recommended approach to allow continuous movement after snapping?Regards,Ria
- LucaMefisto5 months agoProtege
Hi ria_sikla,
For your user case I suggest implementing a custom `ISnapPoseDeletate` and assign it to the SnapInteractable (which should be in the neck of the violin). You can use it to control the pose of the Bow transform when it is Hovering the neck. In `TrackElement(int id, Pose p)` you will receive a call when the SnapInteractor (in the bow) with UniqueID `id` is in the area. You will receive UntrackElement(int id) when it exits.
Then on MoveTrackedElement(int id) you will receive callbacks everytime the InteractorHover updates.
That said, if you are just caring about 1 bow and 1 neck, then maybe SnapInteraction is overkill and you could get away with a Trigger that updates the Constraints of the Transformer of the Bow, or you can also write a custom ITransformer that constraints the position of the bow when it is nearby the neck.