LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

This version of Unity is unsupported.

Rigidbody.ResetCenterOfMass

Switch to Manual
public void ResetCenterOfMass();

Description

Reset the center of mass of the rigidbody.

Computes the actual center of mass of the rigidbody from all the colliders attached, and stores it. After calling this function, the center of mass will get updated automatically after any modification to the rigidbody.