Collider:setCenterOfMass

Edit

Sets the Collider's center of mass, in the Collider's local coordinate space.

This does not change the Collider's position.



Arguments

NameTypeDescription
xnumber The x component of the center of mass.
ynumber The y component of the center of mass.
znumber The z component of the center of mass.

Returns

Nothing

Arguments

NameTypeDescription
centerVec3 The center of mass.

Returns

Nothing

Notes

By default, the center of mass of the Collider is kept up to date automatically as the Collider's shapes change. To disable this, use Collider:setAutomaticMass.

Use Collider:resetMassData to reset the center and other mass properties based on the Collider's shapes.

See also