Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

How to snap object with OVR Grabbable?

JaoewnJaoewn Posts: 1
NerveGear
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! 

Comments

  • GalactigGalactig Posts: 1
    NerveGear
    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.
  • tkdHayktkdHayk Posts: 31 Oculus Start Member
    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.
  • tikitofutikitofu Posts: 7
    NerveGear
    edited March 2018
    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!
  • HenryAshtonHenryAshton Posts: 2
    NerveGear
    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

  • digibixdigibix Posts: 17 Oculus Start Member
    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....
  • FigmentTeamFigmentTeam Posts: 1
    NerveGear
    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 
  • tikitofutikitofu Posts: 7
    NerveGear
    I still have not been able to get this to work properly. Have there been any updates? Thanks!
  • StitchesOTHStitchesOTH Posts: 3
    NerveGear
    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.
Sign In or Register to comment.