Search Unity

OVRGrabbable part of character floats off into space

Discussion in 'VR' started by basilwort5, Jan 20, 2020.

  1. basilwort5

    basilwort5

    Joined:
    Jan 1, 2020
    Posts:
    31
    I am making a project for Oculus Quest, and I have 2 things -- one for me (1st person) and a second for a lever on a machine. What I want to do is use the controller to grab the lever. However, when I release the hand, it floats off into space and the attachment between the lever and machine stretches really far. I'd prefer that the lever stay in same place, attached to the machine. The machine object is a box, with a lever sticking out.

    Approach:
    - Add CustomHandLeft / Right to my character so I have hands in the game that can grab things, with OVRGrabber
    - Add OVRGrabbable to lever
    - Add Capsule Collider to lever (roughly same size)
    - Add Rigidbody to lever, and unticked Use Gravity

    I hope this is some simple setting or setup I've missed.
     
  2. JD_FVTC

    JD_FVTC

    Joined:
    Oct 20, 2017
    Posts:
    54
    Set layers for your player controller(not children) and for your grabbables.
    In your phisics menu uncheck the box where player and grabables cross in your layer collision matrix
     
  3. basilwort5

    basilwort5

    Joined:
    Jan 1, 2020
    Posts:
    31
    Thank you for response, but it did not solve the problem. The lever still flies away when I let go. Another way to phrase the question -- how do I lock the lever to the machine? And, would the same apply to more complex game objects, like a rigged dog with a grabbable paw?
     
  4. basilwort5

    basilwort5

    Joined:
    Jan 1, 2020
    Posts:
    31
    Found 'Character Joint' -- looks promising for what I want to do.