How to fix center of mass (Speed glitch)

As you know roblox has released public animations, some of them change the center of mass, because of this the player can reach a very huge speed

FixCenterOfMass

To fix this, use this simple function on every tool equip/unequip:

local function FixCenterOfMass(_PhysicalProperties: PhysicalProperties, Part: BasePart)
	Part.CustomPhysicalProperties = PhysicalProperties.new(
		_PhysicalProperties.Density - 0.01,
		_PhysicalProperties.Friction,
		_PhysicalProperties.Elasticity,
		_PhysicalProperties.FrictionWeight,
		_PhysicalProperties.ElasticityWeight
	)

	task.wait() -- Don't work without it

	Part.CustomPhysicalProperties = _PhysicalProperties
end

local Character = Player.Character
local PrimaryPart = Character.PrimaryPart
local _PhysicalProperties = PrimaryPart.CurrentPhysicalProperties

Character.ChildAdded:Connect(function()
  FixCenterOfMass(_PhysicalProperties, PrimaryPart)
end)

Character.ChildRemoved:Connect(function()
  FixCenterOfMass(_PhysicalProperties, PrimaryPart)
end)
7 Likes

I haven’t tested this myself, but I believe you can also reset a character’s center of mass by quickly toggling the Massless property of their HumanoidRootPart