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.
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.
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)