Why Is the Rigidbody2D center of mass dependent on the capsule collider offset?

Ihttps://www.gamedev.tv/courses/1394720/lectures/33177591

In the addTorque lesson, I noticed after that the player rotates as if the snowboard is the center of rotation, so I tried to change it to his torso and found that center of mass for the rigidbody (Unity docs said AddTorque is applied to rigidbody) is tied directly to the offset of the capslue collider (snowboard). That seems pretty random?
Is this a property or feature or do you think I made an error somewhere I have to dig for? Thanks you and let me know if you need any more information.

Hi,

The reason for that behaviour is simple: because the Unity programmers defined it this way. Since the manual does not provide any information on their reasoning, we do not know why they made it this way. Maybe their reasoning was that the collider is the actual “body” within the physics simulation while the rest is just decoration.


See also:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms