Game crashes when using ContextActionService:BindAction()

The game crashes when the foo function is called. This function is bound to an action using BindAction . I suspect that the game crashes because the foo function is being called recursively. The crash occurs almost immediately after invoking foo .

I’ve tested this issue on the following platforms:

  • Roblox Studio
  • Mobile
  • Roblox web browser

Replication Steps:

To replicate the crash, follow these steps:

  1. Create a LocalScript.
  2. Add the code below to the LocalScript:
  3. Put the LocalScript inside of StarterCharacterScripts or StarterPlayerScripts.
  4. Play the game and it’ll crash.

Or you can download this place where I’ve already setup the script.
crash.rbxl (56.6 KB)

local ContextActionService = game:GetService("ContextActionService")

local function foo()
	ContextActionService:BindAction("foo", foo, true, Enum.KeyCode.X)
end

foo()

Studio.

Roblox web browser. By the way ‘Hi’ is a TextButton.

Unfortunately, I didn’t record the crash on mobile.