0

Setting mass to zero fixes position

I've run an interesting test I should have before. During a script's initialization method, I grab the first rigid body I can find in a dynamic object and immediately set its mass to zero:

if (Body == null) {
if (!ObjectPrivate.TryGetFirstComponent(out Body))
throw new Exception("No rigid body found in this object");
}
Body.SetMass(0);

Then I start managing its position and orientation, as I have with my of my scripts. But in this script, I stop updating it. I expect it to be free to float off when bumped, but I found, to my surprise, that it maintains its position doggedly. Its orientation is free, now, so it rotates however bumping it says to.

I experimented further using my HTC Vive to see if I could grab it away from its fixed position. Curiously, I am able to! It now behaves like an object in zero G. I can toss it gently and watch it drift off in a straight line wherever and its rotation remain constant.

One curious thing about this, though. I cannot grab and hold onto the object. When I pull the trigger, the object comes to my hand and then starts floating away. Curiously, as a rotate my hand, the object rotates in sync with my hand. It's just floating away while it does so.

Now, if I set the mass to 0.001, I am able to bump the object away by running into it. I seem to be able to grab it and manipulate it okay, too.

4 comments

Please sign in to leave a comment.