Character water density

The devforum states that water terrain has a density of 1, so to make a part neither sink or float, you put its density to 1 as well. Doing this on every part in my character makes it sink either way. I tried adjusting it to like 0.71 which works for my character, but it’s not the same for every character as some still float or sink. Does this have to do something with mass? I found that the BodyHeightScale and BodyWidthScale in the humanoid change the way how strong the density is.

2 Likes

Have you considered using a for i,v in pairs loop to check for accessories? Within the accessories could be the parts that are making the character float.

for i,v in pairs(Character:GetChildren()) do
	if v:IsA("BasePart") then
		--Density stuff
	elseif v:IsA("Accessory") then
		for i2,v2 in pairs(v:GetChildren()) do
			if v2:IsA("Part") then
				-- Density stuff
			end
		end
	end
end

Another way to fix this could be through a remote event to the client of the character you are wanting to sink. By checking if their HumanoidState is set to swimming and if it is. For it to edit the Gravity of the character causing them to sink.

Changing gravity for only one player - Help and Feedback / Scripting Support - DevForum | Roblox

Hope this helps.

I think this does have to do with mass, You can make every pary massless and try to see if it works then?
There should be a property, And if mass is the case you can always make it a default value for ALL characters and then calculate how much density you need per part.