How do I disable/enable front and back character movements?

Hello fellow developers! I’ve been working on my commission for awhile now.
The game is a racing one, so controls need to be somethings like this:
In lobby: WASD, Jump enabled
In game: A (left), D (right), Jumping disabled

I’ve tried many things to achieve this, but ended in vain. I’ve tried editing the PlayerModule, trying to unbind and rebind the front/back context action bindings.

Does anyone know any articles/videos that could help me with this? All the ones I found were changing the old style ControlScript.

Local script:

local context = game:GetService("ContextActionService") 

--disable movement
context:BindAction("movement", function() end, false, Enum.KeyCode.S, Enum.KeyCode.W) 

--enable movement
context:UnbindAction("movement")

to disable jump, just change the Humanoid.JumpPower to 0

1 Like

Thanks alot man! I can’t believe it was this simple lol, really thanks alot.

1 Like