Search Unity

VR Physics hands - instability when grabbing object with both hands

Discussion in 'Physics' started by davidcox70, Nov 2, 2020.

  1. davidcox70

    davidcox70

    Joined:
    Oct 19, 2016
    Posts:
    33
    I have a problem with creating a pair of VR hands that grab objects. All works until they both grab the same non-kinematic object. Then, the rigidbodies go into wild shakes and spins.

    The set up is an astronaut player character which is a rigidbody. Each hand is a separate rigidbody who's position is driven by the XR hand controller's position. Each hand is linked to the player rigidbody by configurable joints. The anchor points of these are moved to match the hand positions.

    When an object is grabbed by one of the hands, a configurable joint is added in script that connects the relevant hand to the grabbable rigidbody target object.

    All works just fine, with the physics of the target grab object nicely feeding back to the player character. But if both hands grab the same non-kinematic object, or two different objects are grabbed and then touch each other, the character is put into violent shakes and spins. There is no problem if both hands grab a kinematic object.

    I'm guessing I'm creating some unsolvable physics loop. Any suggested directions for a solution would be appreciated :)

    David