Is there a way to disable swimming?

Im working on my game, where players are on a isolated main island where the game takes place, but i want the players to fall through the water whenever they stand on it, like a part with CanCollide = false, i tried using a part to represent water, but its nicer to just use water. i tried using a swim controller but i don’t know how they even work. is there a way to make that?

For reference when i said water i meant terrain water.

Use the Humanoid SetStateEnabled and specify using the Swimming enum. There’s more detail and a code example in the documentation link:

2 Likes

thanks a lot! ill look right now

1 Like

Put a local script inside starter character scripts and paste this code into it:

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
2 Likes

ill try it now, hopefully it works

it works! i really didn’t knew much about humanoid states, i should look into them. anyway thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.