- Home /
Collider shapes influence simulation even when not colliding.
If I enable or disable a collider, the rigidbody behaves completely different. Even if the collider is never colliding.
I already found out that adding colliders changes Center-Of-Mass and the Inertia-Tensor.
So I override the center of mass and inertia tensor in Awake(), and still the simulation is completely different, depending on whether the rigidbody has a collider or not.
Is there something else that the collider does to the rigidbody, other than change its C.o.M. and Inertia Tensor?
Thanks!
Answer by unity_DKqnJkGo8MOKYQ · Jan 28, 2019 at 05:56 PM
It turned out that the colliders also automatically change the Rigidbody.inertiaTensorRotation
field.
To not be dependent on collision geometry, you need to explicitly override the centerOfMass
the inertiaTensor
and inertiaTensorRotation
values.
This is somewhat unfortunate, and can easily trip you up (especially coming from other Physics Engines like OpenDE or Bullet.) If an artist changes some collision shapes, the simulation will behave differently!
Your answer
Follow this Question
Related Questions
Rigidbodies won't collide if mass difference is too high 0 Answers
Tree Colliders Not Working With Physics.CheckSphere / Capsule 4 Answers
How do I find whether a point exists within the volume of a (trigger) collider? 0 Answers
Help with floaty rigidbody physics 1 Answer
Passing values from Shader to C# script 0 Answers