ContextActionService bind runs on non-bound key input though key is not defined in tuple

I have provided a clip, it is dark as my game is dark but it should visualise the flashlight easier all be it there is an sfx.

Clip:

cdn.discordapp.com (clip)


The one thing that confuses me is context actions.

For some stupid reason certain keys execute this:

game.ContextActionService:BindAction("Flashlight_Toggle", ToggleFlashlight, true, Enum.KeyCode.E)
game.ContextActionService:SetPosition("Flashlight_Toggle", UDim2.new(0.2, 105,0.2, 0))
game.ContextActionService:SetTitle("Flashlight_Toggle", "Off")

So for example my cmdr config which is Cmdr:SetActivationKeys({ Enum.KeyCode.F2 }) will toggle the flashlight.

Nothing else uses this action or action name and its confusing the hell out of me.


Please note I bearly use context action service. So please bare with me.

I am sure nothing else is having the key being registerd as an input. I dont think there is anything else I could say.

Expected behavior

  • When pressing F2 it should only open cmdr but it also toggles the flashlight.

  • Pressing E should be the only thing that invokes the flashlight toggle however pressing F2 (which opens cmdr) also toggles the flashlight.

Can you share a minimal repro in a placefile of this happening? There’s not quite enough info here to be able to debug what’s going wrong. Thanks

1 Like

Will fo, ill send a pm to you with it.

Resolved in private message. ContextActionService functions receive a cancel state that should be accounted for.

1 Like

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