How to copy WASD movement over to arrow keys (Solved!)

Hello! So as you know Roblox’s current arrow keys only move you around using the UP and DOWN key. Using the LEFT and RIGHT arrow keys simply rotate the camera around.
I was wondering if it is possible to make the left and right keys move you left and right. (so basically making arrow keys like the WASD keys)

I’ve managed to unbind the right and left arrow keys from the camera but I can’t figure out how to make them actually move you left and right.

I’ve dug around inside the default PlayerModule that roblox uses for movement to see if I could copy the code for the “A” and “D” keys and move them over to the right and left keys, but there is so much code in there I couldn’t find nothing.

(This is my first DevForum post so if I need to switch the category or explain something further or anything of the sorts let me know!)

6 Likes

Maybe try using MoveTo() on the player’s humanoid based on the keys they are pressing. Assuming you’re not using this code for a 2D game, you could additionally add some code that moves the player relative to their camera, similar to how Roblox’s default movement script is.

Ok so the way i would do it, is like this
Copy the PlayerModule to the StarterPlayerScripts
Then in the ControlModule.KeyBoard ModuleScript at line 128-129 change it to this:

ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false,
self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.A, Enum.KeyCode.Left )

and line 130-131 to this:

ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false,
self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.D, Enum.KeyCode.Right)

And it should look like this:

Then at the CameraModule.CameraInput comment out or delete lines 448 and 449
image

and then you should be able to move with the arrow keys aswell :slight_smile:

3 Likes

It works perfectly! You are a life saver, really appreciate you taking the time to help me out.

If anyone wants this in the future (and your lazy) put this script in StarterPlayer>StarterPlayerScripts
Script: https://create.roblox.com/store/asset/17537454935/Arrow-keys-like-WASD

3 Likes

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