Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there any way to invert controls? (negative walk speed)

Asked by 8 years ago

Before you used to be able to do this with negative walk speed, but for some reason ROBLOX decided to remove it. Is there any way to change the walk speed to a negative value, or invert the controls?

1 answer

Log in to vote
0
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
8 years ago

You can do this pretty easily. All you need to do is copy the default ControlScript and add a single line to the MasterControl module.


Getting the Default ControlScript

This is most easily done by going into PlayMode in studio and looking under Players > Player1 > PlayerScripts in the explorer. You should see two local scripts, the one we want being called ControlScript.


Modifying the MasterControl Module

Now that you've got the script, copy it to StarterPlayer > StarterPlayerScripts. Open up the 'MasterControl' module parented to the script and go to line 97 (should be an AddToPlayerMovement function). Change this function to the following:

function MasterControl:AddToPlayerMovement(playerMoveVector)
    playerMoveVector = -playerMoveVector
    moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, moveValue.Z + playerMoveVector.Z)
end

The 'playerMoveVector' is now reversed so left is right, forwards is backwards, etc.


If you wanted to be able to toggle this mid game, I would recommend using a RemoteEvent or BindableEvent.

Ad

Answer this question