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 ?
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 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…
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.