Impossible to unbind "jumpAction" on gamepad

When unbinding “jumpAction” through ContextActionService, your character will lose the ability to jump. This is desired.

However if you press A on your gamepad, it will rebind this action and force your character to jump. This makes it impossible for the developer to override the button.

Repro:
Run this code in command line or a local script:

game:GetService("ContextActionService"):UnbindAction("jumpAction") 

Press spacebar (notice you don’t jump)
Press A on your gamepad (notice jump happens)
Checking Developer Console for “Action Bindings” shows it reappears.

3 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

Here’s how I managed to do it

When playtesting in Studio, go under your Local Player > Player Scripts. You should find a module script named PlayerModule
Copy it, then exit playtesting and paste it into Starter Player > Starter Player Scripts

After that, go into the copied PlayerModule > ControlModule > Gamepad. Opening the Gamepad script and scrolling down to the end of the Gamepad:BindContextActions() function should bring up a line where the jumpAction is binded.

All thats left is to delete the entire line

1 Like

Forking this seems to be the only “solution” but they should really just fix their code so devs don’t need to do this :frowning:

1 Like

Hi!

The reason you’re seeing jump happing again is because you’re switching from mouse input to gamepad input. When that change happens, the actions are bound again. To get around this you can listen to UserInputService and unbind the jump action when the input type changes to gamepad, unbind the action. This local script should do the trick.

local userInputService = game.UserInputService

userInputService.LastInputTypeChanged:Connect(function(lastInputType)
	if (lastInputType == Enum.UserInputType.Gamepad1) then
		game:GetService("ContextActionService"):UnbindAction("jumpAction")
	end
end)
2 Likes

adding a task.wait() in your code fix it for me to make sure the jumpAction is found for unbinding