Modifying a character's mass without adding parts

Recently I’ve been messing around with making the character smaller, I took a look at Rocky2u’s Admin script and found out that the smallest size is .5x
I removed the limitation that was put in place to go below the limit and noticed that the character would slide about when moving, I’m assuming this is to do with mass but I can’t seem to work out any fixes for the issue, the segment of code i’ve been looking at is below where C is the Character and S is the value to scale by:

function SCALE(C, S)
	local HAT_CLONE = {}
	
	for i,v in pairs(C:GetChildren()) do if v:IsA('Accessory') then local HC = v:Clone() table.insert(HAT_CLONE, HC) v:destroy() end end
	
	local HEAD = C.Head
	local TORSO = C.Torso
	local LA = C['Left Arm']
	local RA = C['Right Arm']
	local LL = C['Left Leg']
	local RL = C['Right Leg']
	local HRP = C.HumanoidRootPart
	
	HEAD.Size = Vector3.new(S * 2, S, S)
	TORSO.Size = Vector3.new(S * 2, S * 2, S)
	LA.Size = Vector3.new(S, S * 2, S)
	RA.Size = Vector3.new(S, S * 2, S)
	LL.Size = Vector3.new(S, S * 2, S)
	RL.Size = Vector3.new(S, S * 2, S)
	HRP.Size = Vector3.new(S * 2, S * 2, S)
	
	local M1 = Instance.new('Motor6D', TORSO)
	local M2 = Instance.new('Motor6D', TORSO)
	local M3 = Instance.new('Motor6D', TORSO)
	local M4 = Instance.new('Motor6D', TORSO)
	local M5 = Instance.new('Motor6D', TORSO)
	local M6 = Instance.new('Motor6D', HRP)
	
	M1.Name = 'Neck' M1.Part0 = TORSO M1.Part1 = HEAD M1.C0 = CFrame.new(0, 1 * S, 0) * CFrame.Angles(-1.6, 0, 3.1) M1.C1 = CFrame.new(0, -0.5 * S, 0) * CFrame.Angles(-1.6, 0, 3.1)
	M2.Name = 'Left Shoulder' M2.Part0 = TORSO M2.Part1 = LA M2.C0 = CFrame.new(-1 * S, 0.5 * S, 0) * CFrame.Angles(0, -1.6, 0) M2.C1 = CFrame.new(0.5 * S, 0.5 * S, 0) * CFrame.Angles(0, -1.6, 0)
	M3.Name = 'Right Shoulder' M3.Part0 = TORSO M3.Part1 = RA M3.C0 = CFrame.new(1 * S, 0.5 * S, 0) * CFrame.Angles(0, 1.6, 0) M3.C1 = CFrame.new(-0.5 * S, 0.5 * S, 0) * CFrame.Angles(0, 1.6, 0)
	M4.Name  = 'Left Hip' M4.Part0 = TORSO M4.Part1 = LL M4.C0 = CFrame.new(-1 * S, -1 * S, 0) * CFrame.Angles(0, -1.6, 0) M4.C1 = CFrame.new(-0.5 * S, 1 * S, 0) * CFrame.Angles(0, -1.6, 0)
	M5.Name = 'Right Hip' M5.Part0 = TORSO M5.Part1 = RL M5.C0 = CFrame.new(1 * S, -1 * S, 0) * CFrame.Angles(0, 1.6, 0) M5.C1 = CFrame.new(0.5 * S, 1 * S, 0) * CFrame.Angles(0, 1.6, 0)
	M6.Name = 'RootJoint' M6.Part0 = HRP M6.Part1 = TORSO M6.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(-1.6, 0, -3.1) M6.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(-1.6, 0, -3.1)
	
	for i,v in pairs(HAT_CLONE) do v.Parent = C end
end
1 Like

You can change the mass by changing the density of the part (see here on how to do this)
This works as Roblox runs an internal calculation using the density and the volume of the part to get the mass, following the formula Mass = Density * Volume

Hope this helps

2 Likes

did not even known density was a thing, this is very useful information :happy3:

1 Like