ContextActionService not responding to specific input

Hi, i’m making multiple support for my movement system and im having a trouble with ContextActionService.

local ContextService = game:GetService("ContextActionService")

local function FireInput(actionName, inputStatus, _)
	if inputStatus == Enum.UserInputState.Begin then
print(actionName)
        end
end

ContextService:UnbindAction("jumpAction")
ContextService:UnbindAction("RbxCameraKeypress")

wait(0.5) -- Ensure UnbindAction's

ContextService:BindAction("jumpAct", FireInput, true, Enum.KeyCode.Space, Enum.KeyCode.ButtonA)	-- ButtonA isnt getting recognized

All the keys binded to the jumpAct works fine, i also have other actions binded to controller inputs and they work fine too.
But if player presses ButtonA, contextService wont trigger it’s event, even though if the input is correctly recognized by UserInputService. On short terms, input is triggered and recognized correctly, but ContextService won’t trigger ButtonA for some reason

Tell me how this works out.

local ContextService = game:GetService("ContextActionService")

local function FireInput(actionName, inputState, inputObject)
    if inputState ~= Enum.UserInputState.Begin then
		return Enum.ContextActionResult.Pass
	end
    print(`Action [{actionName}] occurred. KeyCode [{inputObject.KeyCode}] pressed.`)

	return Enum.ContextActionResult.Sink
end

ContextService:UnbindAction("jumpAction")
ContextService:UnbindAction("RbxCameraKeypress")

task.wait(0.5) -- Ensure UnbindAction's

ContextService:BindAction("jumpAct", FireInput, true, Enum.KeyCode.Space)
ContextService:BindActionAtPriority("priorityJumpAct", FireInput, true, 2, Enum.KeyCode.ButtonA)

Hey, kinda late, but i tried your code, this is what it makes, only gets triggered once

i think i’ll just use ContextActionService for mobile, i’m seeing too much internal problem with this service

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.