Disable characters movement without walkspeed or anchoring

Hello! I am trying to make the player move using the MoveTo function however I have ran into an issue where the player can simply press WASD to stop their character from moving to the location intended by the script. Can anyone help me fix this?
I don’t know how to explain my situation in simpler terms so I hope you can understand it.

1 Like

In the playerscripts, when the player loads in, a module script called “PlayerModule” is replicated.
Require that via a localscript and do :Disable(), this will disable the players input.

and then to enable it call the :Enable() function

1 Like

So the local script would look like this:

local Plr = game.Players.LocalPlayer
local ControlsModule = require(Plr.PlayerScripts:WaitForChild("PlayerModule"))

ControlsModule:Disable() -- To Disable movement input

ControlsModule:Enable() -- To Enabled movement input
2 Likes

Hope this helps, and good luck with your game/project!

2 Likes

Helloo, sorry I can’t seem to get it working.
I have tried it in character and player scripts but both come back with the error:
Workspace.pingdopong.LocalScript:4: attempt to call missing method ‘Disable’ of table
Do you know how i can fix this?

1 Like

maybe it’s missing :GetControls()???

local playerSV = game:GetService("Players")
local player_crv = playerSV.LocalPlayer
local control_modular = require(player_crv.PlayerScripts:WaitForChild("PlayerModule")):GetControls()

control_modular:Disable() -- unbinds on target devices

control_modular:Enable() -- binds action back
2 Likes

Ah, legend. Thanks man. I saw GetControls in another post but the script didn’t work. This works perfectly thanks!

1 Like

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