Collider size change rigidbody mass ?

Hi !

The size and the shape of a collider attached to a rigidbody will modify its mass.
This is physically logic and understandable but, is it possible to change that ?

In my car game, i am adding newton forces so the car mass need to be absolutely 1500 kg for example.
But the mass is drastically changed with the collider shape.

In real life, the size of the object does not necessary mean that its mass change.
Is there a way in Unity to make the rigid body exactly the mass we defined whatever the shape of the collider ?

Thank you for any help.
J.

Does the shape change in game?
If not i dont see the issue. Just set the mass. And thats it!
Otherwise, perhaps you can have preset vars mass1 mass2…
And if mass1 needed, apply etc.

The way mass works in Unity is simply a number on the Rigidbody. The collider shouldn’t affect anything.

Hi, thank you for your answer.

Collider shape change for every car off course.

The other problem is the fact that i don’t know the exact mass of my rigidbody. I am applying some newton force value so the mass need to be exact to get the expected result.

It does.

Create a square shape, add a rigidbody and the collider that go with it.
Then set the mass to the value you want.

After that add a constant force in the forward direction for example.
Now double or triple the size of your square add the same force in the forward direction and see the result.

Also, adding different colliders to different part will also affect the gravity center point…

Changing the collider has no effect whatsoever on the mass. Only changing the mass value has any effect on the mass.

The result is exactly the same no matter what the size of the object or collider is.

–Eric

Well, maybe this happen because my 4 wheels are connected to the main rigid body via 4 springs joint ?
Need to make some more test.

I am sure that changing the size of the collider give me a different weight…
Or maybe this is because i scale the cube mesh ?

I didn’t tried to only change the collider size without modifying the mesh box.

jujunosuke, this might help:

Unity auto-calculates the inertia tensor of your rigidbody based on the colliders attached to it. If you’re having trouble rotating a large or oblong object, this might be why.

Inertia Tensor is basically a vector that tells the rigidbody how hard it is to rotate around a particular axis. For example, it’s harder to rotate a wooden board long-way then it is to rotate it short-way. You’ll have to play with the numbers to figure out exactly what you need it to be, assuming this is even the problem you were having.

3 Likes