Skip to main content
New Participant
December 29, 2017

How to snap object with OVR Grabbable?

  • December 29, 2017
  • 15 replies
  • 18143 views
Hello!

I've managed to successfully set up grabbing with Grabber but now I would like to go a step further and only allow grabbing at a specific point. In my case, I am trying to pickup a sword only by the handle, and make sure it always faces the correct orientation. I've looked through the documentation for Grabber/Grabbable but I can't seem to find what I need to execute this.

Thank you for the help! 

15 replies

New Participant
February 8, 2020
Just create a box collider and rigid body around the handle of the sword and attach the "OVR Grabbable" script to it. Leave all the options default on the script. This main sword must have a box collider on the blade of the sword and a rigid body, but since there is no "OVR Grabbable" script, you will not be able to pick it up from there. Hope this helps. Worked for me!
New Participant
July 10, 2020
Good, you can solve the problem, resulting in the script 'OVRGrabber' use the global position to make the snap and his thing is that he uses the local one, you can change these parameters of the script and it will work fine!


He just let me upload the code in txt format.
New Participant
November 22, 2020
Did anyone found a solution? thanks 
 
New Participant
December 17, 2020
When I Build the scene with this setting I can grab the sword-capsule like a sword. I hope help you

New Participant
September 18, 2023

I know this issue is years old at this point but I have figured out what's up with snap orientation. The OVRGrabber script gets the object's rotation offset by multiplying whatever you put in the snapOffset GameObject with whatever the rotation is in gripTrans (found in the grip transform option within the OVR Grabber component)... which has a default of (0,0,0). Set the gripTransform's rotation to (1,1,1) in the editor and you'll be able to get snap orientation to work.

The jury's still out on snap position, though. I'll come back here if I ever get it figured out.