Search Unity

Grabbing objects with multiple rigidbodies in VR

Discussion in 'Physics' started by theflatulent, Mar 23, 2018.

  1. theflatulent

    theflatulent

    Joined:
    Mar 23, 2018
    Posts:
    2
    Hi folks,

    I am having trouble figuring out the best way to handle this situation. I am using Rift and the grabber/grabbable scripts. In the game, the player is going to assemble an object. The “main object” has a rigidbody. Its child gameobjects are just colliders. I have had success allowing the players to attach pieces. The pieces have rigidbodies. When I attach the piece, I make it a child to the “main object”.

    I am having to remove the piece’s rigidbody because setting it to kinematic does not work. The piece seems to react to gravity or cause the main object to float in midair. I suspect that when the grabber grabs the main object (changing it to kinematic), it affects the rigidbody of the child.

    I think I need the rigidbody to still be attached, because I want to be able to remove the piece later. I will need to know what piece my grabber is grabbing to be able to pull it off.

    Is there a recommended way of having a grabbable object that has multiple rigidbodies attached? Or should I be thinking about fixed joints or a script to keep the items together without parenting?
     
  2. theflatulent

    theflatulent

    Joined:
    Mar 23, 2018
    Posts:
    2
    You can disregard. I will go ahead and try out the VRTK.