How to disable swimming for character

I want to make it so that the character can walk around in water but not be affected by it, just for a visual effect. I have tried setting the humanoid’s swimming state to not be enabled and I have tried bodygyros but they are janky.

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

This is my code, I have tried setting it on both client and server but my character continues to rotate and swim in water. What can I do?

It should work perfectly in a local script inside StarterCharacterScripts