ContextActionService sometimes stops working?

 local function sprint(actionName, inputState, inputObject)
         print(player)
		 print("Sprinting")
         --code to run
 end)
 
 ContextActionService:BindAction("Sprint", sprint, true, Enum.KeyCode.LeftShift)
 ContextActionService:SetPosition("Sprint", UDim2.new(1,-50,0,-100))

This normally works, but sometimes at a random time for some reason that I still have not discovered.
player and “Sprinting” no longer prints when shift is pressed. What could be the cause of this and what can I do to maybe detect/fix it?

There’s a slight change this fixes it: ContextActionService:UnbindAction("MouseLockSwitchAction")
When placed above the :BindAction assuming ShiftLock interferes with your button.

1 Like

I have shift lock set to “Q” and this doesn’t happen on spawn it happens mid play randomly. But I’ll still give that a shot and see it it helps. Is there any way to show all of the contextaction binds that have been made?

ContextActionService:GetAllBoundActionInfo() and ContextActionService:GetAllBoundCoreActionInfo().

1 Like

You can view them in the DevConsole. Or you can use what PAGO suggested.

2 Likes

Oh I never knew the bindings are directly shown in the console. To be honest I haven’t really been using much else on the console besides the log. I’ll be exploring the console a bit more.
ContextActionService:GetAllBoundActionInfo() does work but the dev console is a bit easier. So if I were to view someone else’s ContextActionService would I have to set up a RemoteEvent and send their info using ContextActionService:GetAllBoundActionInfo()? Or is there an easier way. Because this glitch happens randomly and not always on myself.