Easier way to unbound all ContextActionService actions bound by developer code

As a Roblox developer, it is currently too hard to disable all actions that we bind using ContextActionService effectively. ContextActionService:UnbindAllActions() also unbinds movement controls set by Roblox, which typically isn’t intended when we try to unbind all actions.

For example, I have a game where I bind actions in multiple different locations. Unbinding them all would require me to retrieve them from all of those locations, which would be a hassle. I can’t just have a list in a single script because the names of the actions depend on the player, and players can have multiple different combinations of actions. It’s basically like a skill system, where I need to be able to quickly disable all skills at any time.

Another option to unbind all actions was using ContextActionService:GetAllBoundActionInfo(). However, this function also includes actions bound by roblox.

for action in pairs(ContextActionService:GetAllBoundActionInfo()) do
	ContextActionService:UnbindAction(action)
end

-- does basically the same thing as
ContextActionService:UnbindAllActions()

There doesn’t seem to be much of a use for us to ever use ContextActionService:UnbindAllActions() anyway, unless we’re creating a custom character system and need to unbind the default movement controls. For most of our purposes, this isn’t what we need.

With a function specifically for disabling actions that we set ourselves, we can easily do this without having to worry about the player’s movement controls. Now, we have to go through each action we set ourselves and disable it one by one, manually. In cases like mine, this is even harder.

If Roblox added functions that does this for us automatically, like these:

  • ContextActionService:UnbindDeveloperSetActions()
  • ContextActionService:GetDeveloperBoundActionInfo()

we would be able to accomplish this easily.

22 Likes

This one definitely deservers a bump! :smiley:

2 Likes

Bumping this again, Roblox needs to see this.

Can’t you just add a prefix to check for on the names of the actions gotten from :GetAllBoundActionInfo? Like, DevCerulian_ or GameAction_, or something shorter?