I have been trying to make a part swimming system, and I have the script below so far. The problem is,
when the character stops moving, they fall to the ground abruptly, instead of floating in the water. Also, if you hold w when moving out of the water, you’ll keep swimming on the ground. Look at this video for a visual explanation:
local water = game.Workspace.WaterParts.water
water.Touched:Connect(function(hit)
local plr = hit.Parent:FindFirstChild("Humanoid")
if plr then
plr:SetStateEnabled("GettingUp", false)
plr:ChangeState("Swimming")
else
plr:ChangeState(Enum.HumanoidStateType.Running)
end
end)