cancel
Showing results for 
Search instead for 
Did you mean: 

How to snap object with OVR Grabbable?

Jaoewn
Honored Guest
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 15

Galactig
Honored Guest
set up a an empty gameobject at position (0,0,0) and rotation (0,0,0) in the unity scene. attach this as your snap offset transform in the ovr grabbable script. change the rotation or position values of this empty object by the amount you want the object to offset when you grab it.

tkdHayk
Protege

Galactig said:

set up a an empty gameobject at position (0,0,0) and rotation (0,0,0) in the unity scene. attach this as your snap offset transform in the ovr grabbable script. change the rotation or position values of this empty object by the amount you want the object to offset when you grab it.


this does not work for me.

tikitofu
Explorer
I'm also struggling with this. It seems the object is being offset, but not as expected. If I use an unparented Empty at the origin, it still places my object a few meters away.  I can't seem to find any additional documentation or code comments.   Thanks!

Anonymous
Not applicable
Same thing happening for me, the object is way offset from the hand and changing the snap offset transform does nothing? Anyone ever solve it? Thanks

Digibix
Protege
The empty game object for the snap have to be on the scene (unparented) NOT a child of the hands object..... at least that fixed it for me.... 

Also make sure to check Snap Position and Snap Rotation on the Grabbable script....

FigmentTeam
Honored Guest

digibix said:

The empty game object for the snap have to be on the scene (unparented) NOT a child of the hands object..... at least that fixed it for me.... 

Also make sure to check Snap Position and Snap Rotation on the Grabbable script....


Hmmm, I have the empty GO at (0,0,0) and when I grab an object it still has an offset 

tikitofu
Explorer
I still have not been able to get this to work properly. Have there been any updates? Thanks!

ExodusOTH
Explorer
Just a bump. As of January 2019 this bug still exists. For me, having the empty GO placed at (0,0,0) with (0,0,0) rotation gives the grabbable object a few meters offset anyway. I've also noticed that the amount of offset changes, and is not consistent (i.e. it's not always 2 meters off in the x direction. It might be 1.342 in the x and another amount in the Y and Z and then on it's next grab it will be completely separate numbers for each value). Either we are all completely not understanding how the Snap Offset is supposed to be used (a demo scene would be LOVELY :D) or it has been bugged for over a year. This was all checked with the latest version of Oculus Integration on the Unity Asset Store (Version 1.32 released on December 19, 2018) and is still bugged.

tasook
Honored Guest
Same problem here! Exactly what StitchesOTH is describing. Any news?
Cheers!