When connecting a ContextActionService binding to Enum.PlayerActions.CharacterJump, and then using ButtonA on controller to trigger the binding, the callback is not invoked consistently opposed to other methods of triggering Enum.PlayerActions.CharacterJump.
How to repro:
- Open a new baseplate
- Press Play Solo (accurate or not)
- Connect the binding by putting this in the command bar:
game:GetService("ContextActionService"):BindActionAtPriority(
"TestButtonA",
function()
print("test")
end,
false,
1e9,
Enum.PlayerActions.CharacterJump
)
Observed behavior:
When pressing space bar, the behavior is as expected:
- Pressing space bar causes “test” to be printed (start of action)
- Releasing space bar causes “test” to be printed (end of action)
When using ButtonA on a connected controller instead, one of these situations is observed:
- Either: pressing ButtonA once will print “test”, but releasing it does not, and no subsequent presses of ButtonA will trigger the callback.
- Or: Pressing ButtonA will trigger “test” to be printed consistently, but releasing ButtonA will never trigger “test” to print at all.
- It is never the case that ButtonA triggers the callback correctly for both pressing and releasing the button, unlike when using space bar.
Expected behavior:
It should be the case that the binding triggers correctly when ButtonA is pressed and when the button is released.
Additional notes:
I’ve also seen this happen to bindings that are connected to Enum.KeyCode.ButtonA directly rather than to Enum.PlayerActions.CharacterJump.
I have only tested this in Studio but assume that it occurs in both.
It might be related to the fact that Roblox associates ButtonA with jumping, although it really should not because I have a priority on my binding (1e9) that far exceeds that of any existing binding.