ControlModule:Disable() Does Not Stop Movement

Since the PlayerModule update today, ControlModule::Disable locks in the player’s inputs (such as holding W or spacebar at the time of the call), causing movement to continue, whereas the old ControlScript would stop all movement at the time of disabling it.

Repro:

  1. Paste this code into a LocalScript
local player = game.Players.LocalPlayer
local PlayerScripts = player:WaitForChild("PlayerScripts")

local ControlModule = require(PlayerScripts:WaitForChild("PlayerModule"):WaitForChild("ControlModule"))

print("Disabling controls in 3 seconds")
wait(3)
ControlModule:Disable()
print("Disabled, let go of your movement or jump input, and notice it is locked in.")
wait(.5)
print("Enabling controls in 3 seconds")
wait(3)
ControlModule:Enable()
print("Enabled, notice that you can now un-lock the controls by inputting them again.")
  1. Press play and hold down W to move forward.
  2. Observe comments being printed, once disabled, release the W key; you will continue to move forward with no way top stop it, once re-enabled, you will still be moving forward until you press W again.

This is undesired behaviour and was not the case with the previous version of the ControlScript.

This has been fixed with Part 2 of the PlayerModule release.

3 Likes

Ah, OK. I can change this behavior as well. I agree that it makes sense to send a zero movement vector to the humanoid when there is no active controller.

3 Likes

In my case I want the input to lock (like holding W and having the movement continue) is there a way I can achieve this with the current Movement scripts?

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