Don't exactly get the "inputTypes" parameter in ContextActionService:BindAction()

So I’m making a mobile button for my game but I don’t get what “inputTypes” means in the :BindAction() function.

What do the “inputTypes” do?

I read this topic: How To BindAction To The Mobile Jump Button and it said this:

This didn’t really help.

Basically all I need is an explanation on what they do.

They are just the buttons that will call the bound function. In that example, you are basically keybinding the spacebar and the X button on xbox to the JumpButtonAction function. Depending on the context of the action, the function will be called when you press one of those two.

So if I did Enum.KeyCode.E the function would run if E is pressed (as in on a computer)?

1 Like

So that means I don’t have to do both of these functions?

uis.InputBegan:Connect(function(input)
	if not forceDeb then
		if input.KeyCode == Enum.KeyCode.E then
			forceEvent:FireServer(plr:WaitForChild("ForceSkillType").Value)
			forceDeb = true
			wait(1)
			forceDeb = false
		end
	end
end)

local function mobileForce()
	if not forceDeb then
		forceEvent:FireServer(plr:WaitForChild("ForceSkillType").Value)
		forceDeb = true
		wait(1)
		forceDeb = false
	end
end

The latter function would work, assuming you made the ContextActionService binded.

1 Like