How do I make my own movement script

Hello, I am currently trying to make a game where you need to control 2 characters and I would need to know how can I make a script to control the second one with different keys then WASD and arrows. I tried to check the control scripts inside PlayerScripts but I couldn’t find an answer by myself… Any help is appreciated

Is this going to be a 2D game like [Fireboy and water girl link] ?

Hum, there would be similarities… And yes, its 2D

By 2D do you mean like the movement of a line runner game?
Like this?
image

And then obviously you would add the second character. If so then I would suggest having a look at the default Roblox one, seeing how the camera and movement work in that one. Then I guess you could be able to duplicate that to work for arrows.

Or

You could just disable the default movement system by setting DevComputerMovementMode to scriptable so you create your own movement system from scratch.

Then you would be able to naturally do the camera, and use UserInputService.InputBegan and UserInputService.InputEnded to work out who and what is moving.

1 Like

That’s what I also thought at first, but how would I make the character actually move ? Because I know how to use userInputService but not how to make the character move…

Is it GUI based? If so, you would need to worry about collisions as they take ages to write one, I’ve wrote a simple one but just asking.

I’m assuming it’s part based. To create a character controller, you’ll first need to give the player network ownership of the assembly. This allows the player to control the character from the client. After this, you’ll just need to use the UserInputService or another input handler to get and act on user input.

https://developer.roblox.com/en-us/api-reference/function/BasePart/SetNetworkOwner


If it is GUI based you should look into nature2d and remote events.

assuming that he want wasd 2d, not wd so that wouldnt help that much.

1 Like

I was assuming he wanted 2d, not 3d, so that wouldn’t help much.

Whoops! I didn’t see the OP mentioned it is 2D movement. The OP also said it was like the line runner game, so I assume it’s 3D and part based.


@OP

You first need to give the player network ownership of the character, then you can control the character from the client. To control a character, add a humanoid to the rig and use Humanoid.Jump and Humanoid:Move() to control the character (control the character based on Humanoid:GetState() and the UserInputService).