Player sinking in water?

My character doesn’t float in water like it’s supposed to. It sinks. When I hold space and start floating, it slows me down.

Is it possible to script a fix for this?

Video:

1 Like

Have you made any physics adjustments to your game? eg: Gravity

1 Like

No, I haven’t adjusted any gravity or anything.

1 Like

Are their any scripts that could change the way the player behaves?

1 Like

What type of scripts would change this?

Are there any parts attatched to the player that may have a higher density than water?

1 Like

I don’t think there is any.

chars

The density on characters are by default 0.7, anything with a greater density than the density of water which is rounded to 1 will sink in water so it should be working by default which means I’m not sure if this will fix it but you could try.

Put this script into the StarterCharacterScripts, what it does is it decreases the density of all the parts in the player including hats. Make sure it’s a server script.

Density = 0.5 -- change to try a different density, the lower density the easier it will float..

c = script.Parent:GetChildren()

for i = 1, #c do
	if c[i]:IsA("BasePart") then
		-- it goes density, friction, elasticity, frictionweight, elasticityweight but all you need to change is density
		c[i].CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
		
		elseif c[i].ClassName == "Accessory" then
		c[i].Handle.CustomPhysicalProperties = PhysicalProperties.new(Density, 0.3, 0.5, 1, 1)
	end
end
6 Likes

I had the same problem with my game this comment is the solution.

1 Like