User Tools

Center Of Mass

CenterOfMass inspector.

This script has been replaced with VariableCenterOfMass in v2.5.

A helper script for setting center of mass of a Rigidbody.

Unity calculates center of mass as a center of volume of all the Rigidbodys Colliders. This can and will result in unrealistic center of mass for objects that do not have uniform density, i.e. center of mass will not have to be adjusted for a wooden log but a ship has a ballast and is noticeably heavier around the keel and therefore the center of mass is low which in turn prevents the ship from capsizing.

  • Center Of Mass Offset - offset of the center of mass from the Unity calculated one in local coordinates.
  • Show COM - when true a green gizmo sphere will be drawn at the current center of mass.