ContextActionService:BIndAction() interrupts/stops dynamic thumbstick when binding function to Touch

To reproduce this issue, you can run the following code:

while task.wait(5) do
	game:GetService("ContextActionService"):BindAction("test", function()
		return Enum.ContextActionResult.Pass
	end, false, Enum.UserInputType.Touch)
end

Whenever I bind an action to Touch with CAS, it interrupts the dynamic thumbstick on mobile. This is causing problems for my custom inventory system. When a player tries switching weapons on mobile, BindAction() is called in the weapon setup code, and this will interrupt their running, forcing them to lift their finger and trigger the dynamic thumbstick again. Is there any way to get around this? What’s causing this behavior? It doesn’t occur with the classic thumbstick, so I assume it’s a bug in the Dynamic Thumbstick code.

Seems that this is because the dynamic thumbstick stops itself whenever touch input is cancelled and, per the wiki:

binding two action-handling functions will cause the first to Cancel if an input was already in-progress when the second was bound.

This means that the only solution (if you want to bind something to touch without interrupting player movement) is to fork the dynamic thumbstick code and comment out these lines:

elseif inputState == Enum.UserInputState.Cancel then
	self:OnInputEnded()

Not sure I’m satisfied with this as a solution, but the only other choice is to disable the dynamic thumbstick.

1 Like