Forum Discussion
theflatulent
7 years agoHonored Guest
Grabbing Objects with Multiple Rigidbodies in Unity
Hi folks,
I am having trouble figuring out the best way to handle this situation. I am using Rift and the OCVRgrabber/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 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 colliding with 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?
I am having trouble figuring out the best way to handle this situation. I am using Rift and the OCVRgrabber/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 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 colliding with 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?
1 Reply
Replies have been turned off for this discussion
- theflatulentHonored GuestI am using Unity 2017.3.0f3. You can close this if you want. I will go check out the VRTK.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 1 year ago
- 3 years ago