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

How to unbind movement keys and rebind them?

Asked by 4 years ago

I guess the title is pretty self-explanatory.

2 answers

Log in to vote
0
Answered by
Luathron 185
4 years ago
Edited 4 years ago

PlayerModule --> ControlModule --> Keyboard, line 120-129:

01ContextActionService:BindActionAtPriority("moveForwardAction", handleMoveForward, false,
02    self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward)
03ContextActionService:BindActionAtPriority("moveBackwardAction", handleMoveBackward, false,
04    self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward)
05ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false,
06    self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft)
07ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false,
08    self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight)
09ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
10    self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump)

You can adjust these to rebind some controls, for example on line 120, changing handleMoveForward to handleJumpAction, you'll jump when you press w. But I don't think it is currently possible to bind custom keys to these actions, if that's what you wanted.

Ad
Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
01---###----------[[SERVICES]]----------###--
02local ContextActionService = game:GetService("ContextActionService")
03 
04 
05 
06---###----------[[VARIABLES]]----------###--
07local DisableMovementAction = "DisableMovement"
08 
09 
10 
11---###----------[[LOGIC]]----------###--
12ContextActionService:BindActionAtPriority(
13    DisableMovementAction,
14    ---------------
15    function()
View all 26 lines...
0
Can you elaborate on how to bind inputs to different actions, say moveBackwardAction? Feedekaiser 25 — 4y

Answer this question