Search Unity

Question mass on objects you can pick up.

Discussion in 'XR Interaction Toolkit and Input' started by TheCodingNoob, Jan 5, 2021.

  1. TheCodingNoob

    TheCodingNoob

    Joined:
    Jan 10, 2020
    Posts:
    14
    Hi. i have recently started making VR games and is working on a puzzle/story driven game just for fun. like in boneworks when i pick up objects i want them to have mass for example. if i try to pick up a small rubber ball then i want it to have a low mass like it has now. but if i pick upp a centerblock i want it to be heavy. move slower is easy to fix but with how high i can lift an object i can't seem to find a good solution. do i have to limit the transform on the object or is their a better way. changeing the mass on the rigidbody dose nothing for me.
    Im using the XR Interaction Tollkit, with a XR Grab Interacteble on a cube and the XR Direct Interactor on my hands.
     
  2. Matt_D_work

    Matt_D_work

    Unity Technologies

    Joined:
    Nov 30, 2016
    Posts:
    202
    so, when you use the grab interactable, the interactable will follow the position of the controller. As the controller has no concept of the "weight" of the object within unity, you'll need to add this logic yourself.

    the way to do this would be to modify the controller attach point, as this is what the "grab" interactable will move towards. you can then simulate a "fishing pole" type effect when interacting with objects based on their weight. you'll probably also want to use some haptics to convey concept of additional force. its quite hard to convey this well to the user!