Heavy rigidbody moves easily after collision

I have an object with a rigidbody set to 100,000 mass. I have another object with a capsule collider. When the capsule collider moves and makes contact with the other object, this object with 100,000 mass moves around the scene like it’s an air-filled balloon.

This is the heaviest object in the scene. Nothing should be able to move this object.

What am I not understanding about rigidbodies and colliders?

EDIT: When driving around in the heavy object, TANK, if I run into a small curb, the tank flips over like it is filled with helium. Also, swinging around the turret, if the cannon collides with a building, the tank flips uncontrollably around in the air. All 3 objects (street, tank, buildings) use Mesh Colliders. Some buildings use box colliders.

Is you capsule collider set to is kinematic?

–

What physical materials are you using on your objects?

–

Add a high friction material to your heavy object and to the object that it is resting upon, let us know if this makes any difference at all.

–

I don't know if I did it right but I created a Physics Material. I added that material to the Mesh Colliders of the large object. I added that material to the Mesh colliders of the ground. It is still light as a balloon. I set the Friction numbers to 1,000,000 even and nothing changes.

–

I've switched to a trigger, how I should have done this all along, and now I can interact with the object without moving it. HOWEVER, when I switch to control the object, a tank, I can swing the turret around and hit a building. This causes the tank to flip uncontrollably like a balloon. I am still having trouble with this rigidbody.

–

3 Answers

3

Its because of drag force. When some force is applied on rigidbody it can move continuously without drag, like objects do in open space. Try to set drag to 1.

No change.

–

I've switched to a trigger, how I should have done this all along, and now I can interact with the object without moving it. HOWEVER, when I switch to control the object, a tank, I can swing the turret around and hit a building. This causes the tank to flip uncontrollably like a balloon. I am still having trouble with this rigidbody.

–

I don’t use force to move the turret.

There is your answer. If you are moving any rigidbody with Transform.position, Transform.Translate, Transform.Rotate or any of the transform functions then you override the physics engine calculations. The physics engine then moves everything else around in your scene to match up.

There are multiple set ups you could use to fix. Most logical to me would be giving the turret its own rigidbody. Attach it to the tank using a hinge joint. Rotate it by adding torque or force as appropriate. This will make your turret conform to the physics engine rules.

Agreed, do exactly what BoredMormon says :D

–

Sounds about right. Be aware that none of the rigidbodies can be children of any other rigidbodies. That will cause the physics engine to do even more crazy things. Another potential solution would be to use animations and animate physics. That's outside of my area of expertise.

–

The answer is joints. You can put it all together into a single prefab for spawning purposes.

–

As I am making the new tank and making the joints I'm realizing that when I am done I can make a new prefab and then drag all 4 GameObjects into that prefab and I am done, correct?

–

Yup. Basically you want all four GameObjects to be a child of the same root

–

Try setting collision to continuous in the rigidbody of the heavy object (default is discrete).

How’s your framerate? If it’s low (like 20 or under) you might be getting interpenetration, and physics systems don’t like that.

I set collision to continuous. No change. The frame rate is from 8-12 fps

–

I've switched to a trigger, how I should have done this all along, and now I can interact with the object without moving it. HOWEVER, when I switch to control the object, a tank, I can swing the turret around and hit a building. This causes the tank to flip uncontrollably like a balloon. I am still having trouble with this rigidbody.

–