Is there any way I could disable a player's ability to walk without nullifying Humanoid.MoveDirection?

  1. What do you want to achieve? I’m currently trying to make a custom movement system which relies heavily on Humanoid.MoveDirection. I’m currently looking to implement a custom walking system with wider turns using Humanoid:Move().

  2. What is the issue? I cannot disable the player’s default walking without nullifiying Humanoid.MoveDirection.

  3. What solutions have you tried so far? So far I have tried:

  • Setting Humanoid.WalkSpeed to 0, this causes Humanoid:Walk() to not do anything.
  • Setting the Humanoid.DevMovementModes to scriptable, this nullifies Humanoid.MoveDirection.
  • Disabling controls through the player’s PlayerModule, this nullifies Humanoid.MoveDirection.

I’m sorry if this post is sloppy in any way, this is my first time posting here.

1 Like

try using the humanoidrootpart direction instead

I am not in need of the character’s LookVector, it’s the MoveDirection Vector that I need.

1 Like

js use body movers like velocity or position set the y to the humanoid pos or just anchor the character

1 Like

i understand that you are using the MoveDirection property but why you do not try using the humanoid root part look vector and force shift lock

This can be accomplished through modifying the default PlayerModule. This is my implementation, but all you really need to do is replace the controller’s moveFunction with your own that does nothing and grab the walkDirection argument.

If you’d like to use my code, paste it into a LocalScript and put it under StarterPlayerScripts.

local PlayerModule = require(script.Parent:WaitForChild('PlayerModule'))
local controls = PlayerModule.controls -- Grab the ControlModule

local enabled = true 
local oldMove = controls.moveFunction -- Grab old moveFunction that will be replaced
function controls.moveFunction ( self: Player, walkDirection: Vector3, relativeToCamera: boolean? )
    if ( enabled == false ) then
        return oldMove(self, Vector3.zero, relativeToCamera) -- Don't move at all
    end
    return oldMove(self, walkDirection, relativeToCamera) -- Move like normal
end

local humanoid = controls.humanoid -- Get character humanoid
while true do 
    -- Alternate between enabling and disabling the default controller
    if ( math.floor(tick()) % 2 == 0 ) then
        enabled = false 
    else
        enabled = true 
    end

    print('Humanoid.MoveDirection: ', controls.humanoid and controls.humanoid.MoveDirection) -- Humanoid.MoveDirection flips between an empty vector and the correct input vector
    print('MoveVector', PlayerModule.controls.inputMoveVector) -- the inputMoveVector keeps the input value even when not moving

    task.wait(0.1)
end