Swimming animation glitch

hello!

I’m trying to make a swimming animation for my custom character but the problem is when i enter the water the character immediately fall down to the bottom of the water idk why

why this is happening and how can i fix this?

1 Like

The character is snapping to 90 degrees to play the swimming animation. To fix this you can disable the swimming state.

Put this in a local script inside the character:

local Humanoid = script.Parent:WaitForChild("Humanoid")
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)

You can then make a custom swimming script and controls which shouldn’t take that long.

4 Likes

thank you so much for helping! , the problem is fixed the tiger is no longer glitching in the water but the animation doesn’t play also how can i change sum stuff in the swimming settings like how high the character float when he is in the water etc…

Disables the default roblox swimming script. When you go in the water it now should do nothing without a custom swim script.
To detect when someone is in the water, you can use This and then play the swim animation if they are inside water. You can create the custom swim script from there

1 Like

hmmm…,its not printing (working) for some reason.

The water detection? I need more characters

Yep the water detection its not printing when I’m inside it

Try something like this:

local Char = script.Parent
local Root = Char:WaitForChild("HumanoidRootPart")
local Humanoid = Char:WaitForChild("Humanoid")


Humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)

while task.wait() do
	local Min = Root.Position - Vector3.new(2, 2, 2)
	local Max = Root.Position + Vector3.new(2, 2, 2)
	local Region = Region3.new(Min, Max):ExpandToGrid(4)
	local Material = workspace:FindFirstChildOfClass("Terrain"):ReadVoxels(Region, 4)[1][1][1] 
	print(Material)
end

(Local script parented in character)

1 Like