How to make it so my character can't move with s and w

I have searched on google and devforum, but have not found an answer to a pressing question. I am making a 2.5D platformer on ROBLOX. I don’t want players to be able to move forward or backward (using s and w keys), only right or left. Please help!

I’ve found a few topics on things like this. Some may be on W and S, but all you have to do is change that for A and D.

There’s more, this is just a couple that might help you the most.

1 Like

Whoops lol sorry I mixed it up. I will let you know if it works.

1 Like

I put this in StarterCharacterScripts yet nothing happened. I can still move all directions. :sad:

local ContextActionService =game:GetService("ContextActionService")
local FowardMovement = Enum.PlayerActions.CharacterForward
local BackwardMovement = Enum.PlayerActions.CharacterBackward

local function Sink()
	return Enum.ContextActionResult.Sink
end

----Sink forward movement 
ContextActionService:BindAction("SinkFowardMovement", Sink,false,FowardMovement)

----Sink backward movement 
ContextActionService:BindAction("SinkBackwardMovement",Sink,false,BackwardMovement)

Did you try the first link i showed you? Maybe that will work?

1 Like

Never mind, it was something else.

1 Like