Preventing player from lying down while swimming in water terrain

Hi Devs,

How do I prevent players from lying down while swimming? Yes, the player just stands when they’re not moving in the water, but I want them to move in the water terrain without lying down.

Like this. Keep in mind that while the player is moving

Do you want the physical characteristics of a swimming player to remain the same? Or do you want to completely override the swimming of a character and force them to walk/run instead?

Yes, I want to override it. I want to stop the player from lying down.

So you just want them to be running in the water? Or do you want to swap the animations?

I want them to stand still and play idle animation, but when they move they will not lie down like the image above

How about you swap the swimming idle and the swimming animations for normal idle and running animations?

It doesn’t work, What I mean is like this

I want to stop them from lying down like this
robloxapp-20201229-1402335.wmv (1.1 MB)

This is what i want to achived:

The way to achieve this is to disable certain animations, so it overrides the default behaviour when in water. I did this with the following in StartrPlayerScripts

-- In a LocalScript
local Player = game.Players.LocalPlayer
local Character = Player .Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")


-- DISABLE SWIMMING
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)

local function stopSwimming()
	while not Character or not Character.Parent do
		Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
	end
end

Player.CharacterAdded:Connect(function(Char)
	Character = Char
	Humanoid = Char:WaitForChild("Humanoid")
	Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
end)

Probably not the ideal way to achieve it but it worked for me

2 Likes

Hi thanks for the response, but I already solve it on my own, what I did is everytime a player move in the water terrain I play an animation that flip above so it will still look like it’s standing while moving in the water.