What's the best way to remove forward and backward movement for **mobile** players?

My friend and I are making a 2D platformer game, and while my friend and I have removed the functionality of the W and S keys, we’re unsure on how to remove moving forward and backwards directions for mobile. Our initial thought was to allow them to use DPad and then just remove the forward and backward keys, however roblox seems to have fully disabled those from being used, even if forced in StarterPlayer. Any ideas?

NOTE: We are using a PlayerModule from sometime after the removal of the option to use DPad and Thumbpad and if you know how to enable DPad it’d be greatly appreciated lol

2 Likes

Based on what I’ve experienced with messing around with mobile controls, you should be able to find something in the “TouchThumbstick” or “DynamicThumbstick” module under the player ControlModule.:

image

2 Likes

Yeah, I was looking at DPad which still exists in the playermodule i’m using. No clue why they don’t allow you to enable it when it still exists.

1 Like

My suggestion is to find out how to disable the JoyStick and create your own! Shouldn’t be too hard, you would need to test if the player is on mobile, if so give them a custom movement GUI, and then move their character based on the GUI inputs.

1 Like

Yeah, that’s what I’m goign to do as a last resort, and i’m getting to that point lol

Usually what I do for disabling movement which works for all devices is using bodyvelocity and making it only effect the forward and backward movement with the max force only in the right axis and velocity set to 0.

BodyVelocity.MaxForce = camera.CFrame.RightVector:Cross(Vector.yAxis).Unit * 10^6
2 Likes

Player movement is binded by ContextActionService. Meaning that you can do ContextActionService:UnbindAction() to remove the Bindings. I don’t know what these bindings are called but you can look in the console’s ContextActionService page to see the names of the Bindings.

They will be able to use the ContextActionService:GetAllBoundActionInfo() to get all the current bound actions, but last time I have tried it it doesn’t really work with touch controls.

But it would be a simple solution for PC.

I put mobile in the title for a reason lol

But thank you _ _______________

I thought of an idea to What you could do by that is check if the Player is on mobile in The script if he is then do that.

But, there is probably a better way.