Dampening character movement?

I first tried posting this to the game design subforum, but got no replies in the first 21 hours so I’ll try here amongst the most capable of mankind.

In the video example I’ve set the density of the character parts to 0.02 in order to have a nice dampening effect on the movement. As a downside, the character wont sink in the water. Not even for a brief moment for a script to identify this orange vested punk ever moistened its toes.
I’ve searched far and wide online for help, but never found anything.

I believe there is an alternative option, perhaps using bodymovers? If you happen to know how, please lead me on the right path to dampen this poor mans footwork. Thank you

Solution:

local function changeDensity(thicc)
local parts = script.Parent:GetChildren()
	for i = 1,#parts do
		if parts[i].ClassName == "Part" or parts[i].ClassName == "MeshPart" then
			local physProps = PhysicalProperties.new(thicc,0.3,0.5,1,1)
			parts[i].CustomPhysicalProperties = physProps
		end
	end
end

script.Parent.Humanoid.StateChanged:Connect(function(oldState, newState)
	if newState == Enum.HumanoidStateType.Freefall then
		local thicc = 0.7
		changeDensity(thicc)
	elseif newState == Enum.HumanoidStateType.Running then
		local thicc = 0.02
		changeDensity(thicc)
	end
end)

It may be best to return the density values to normal, and create your own control module. Perhaps using a forked version of Roblox’s module to accomplish this. You can use tweenService to get a smooth effect, you’ll have to modify the code at the keycode levels.

Another thing you may be able to try is returning the density values to normal when it contact with water.

1 Like

I would just start the walk speed at like 5-8 and then scale up to 16 over a second of movement or so.

Edit: Oh I see what you mean, I’ll try to think of something else. Body movers may be the best route.

It would probably be easiest to replace the movement code that utilizes MoveTo in the Roblox control script to instead give you a body velocity in that direction. When changing directions, scale the previous direction down before adding the new directional velocity. It should be a fairly simple change.

You mean modifying ControlModule rendersteps? I could try twisting that.

And as I stated

Blockquote the character wont sink in the water. Not even for a brief moment for a script to identify this orange vested punk ever moistened its toes.

the humanoid doesnt identify touching water since it just keeps falling while floating above it, so I can’t really rely on that.

You would set the density back to normal so water works normally.

Wouldn’t that mean MaxSlopeAngle turns indifferent? If not, sounds like a solid investment lmao.

I’ll try making density back to 0.7 while character is falling. Should’ve tried that by now but thanks! :smiley:

1 Like

Yeah, it was that simple. Used Humanoid.StateChanged() in a localscript at StarterCharacter.

local function changeDensity(thicc)
local parts = script.Parent:GetChildren()
	for i = 1,#parts do
		if parts[i].ClassName == "Part" or parts[i].ClassName == "MeshPart" then
			local physProps = PhysicalProperties.new(thicc,0.3,0.5,1,1)
			parts[i].CustomPhysicalProperties = physProps
		end
	end
end

script.Parent.Humanoid.StateChanged:Connect(function(oldState, newState)
	if newState == Enum.HumanoidStateType.Freefall then
		local thicc = 0.7
		changeDensity(thicc)
	elseif newState == Enum.HumanoidStateType.Running then
		local thicc = 0.02
		changeDensity(thicc)
	end
end)
1 Like