Freeze object when i let it go

Hi!

I want to do something like this simulation. I use Leap for the interaction, with grabbable hand. I use Grabbable object script, and rigidbody for the object. When I switch off the gravity, the object was fly away in the space… When I switch is kinematic, do nothing. I would like to solve, when I let go the object, its freeze, do not rotate, or fly away.

Please help me!
Thanks.
Michael

(

Hi!

When I attached this javascript to the object, and I press the space button, the object was stop to floating, and its freeze, but rotating. That’s not bad, but not good at all. My question is, how can I stop the object rotation with this script, and how can i do this, without pushing the space button? Like in the video!

Thank you very much!
Michael

You can set that movable object as child to hand when grabbing it and “unchild” it when releasing grab.

1 Like

Thanks! This sounds great! I can set it with the hierarchy panel, or can I do this with a script?

Thanks! The movable object hierarchy is working with grabbable hand, but the problem is the same: when I turn off gravity it was fly away, and when I turn on “it kinematic” it’s don’t movable, when I grabbing. What can I do?

try this?
collider.enabled =false;
rigidbody.isKinematic =true;

or try rigidbody.Sleep

i think it’s better to make bool expression like if collider.enabled=false;
make the boolean true and if boolean true when rigidbody.iskinematic=true; and freeze it and if goes false then do what ever you want .