I made a GUIButton that toggles the player to swim as if they were in water, but when I am swimming mid air and let go of all movement keys, the player still moves as if it were sliding on ice.
I’m trying to write a localscript that detects the MoveDirection in the localplayer’s humanoid object and anchors the HumanoidRootPart if the button is activated and the player is not moving, but unanchors it when the MoveDirection is anything other than “0,0,0” here is that script below (I corrected the spelling error in line 4):
Here is the script to make the player swim (it works as intended other than above issue):
I corrected the spelling mistake in the top script, as well as removed “Character” and now it just anchors HumanoidRootPart when I click it rather than only when the text says “Swim: ON” and the MoveDirection is 0,0,0