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
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.:
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.
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.
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.