In order to open up the left and right DPad KeyCodes, I need to unbind a context action relating to the camera. The function is binded in a ModuleScript named "BaseCamera", the action is named "BaseCameraGamepadZoom".

Now comes my issue, from my knowledge I have no way of detecting whether the function has been binded or not and currently i'm unreliably waiting 8 seconds before unbinding it and most of the time it doesn't work. Does anybody know of any way to detect when it's binded, I only want to fork the camera script if there's no possible solution to this.

My current script (unreliable, gross, only works 50% of the time):

lp:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule"):WaitForChild("CameraModule"):WaitForChild("BaseCamera")
wait(8)
game:GetService("ContextActionService"):UnbindAction("BaseCameraGamepadZoom")

2 comments

0

This is just one of the limitations of the ContextActionService. You might be better off overriding the camera script that binds the action.

0

Found a solution, I just binded the same keycodes but with a priority. Glad I won't have to fork the player script!