Hi there
Let’s me ask you a question, if you have the choice, which will you choose, UserInputService or ContextActionService?
Neither. Use Input Action System.
Hey. UserInputService is much better because CAS is pretty dated and limited.
Input Action System is instance oriented which will make it be a pain to keep track of and performant cost. It’s also fairly limited.
UserInputService however can be directly embedded into a script since it’s a Service. It’s harder to use than IAS imo but the difference can be negligent if you get used to both. UIS also has access to gyroscopes, haptics and so on and it’s signals allow for a much more varied logic control.
use UserInputService but make a custom input system wrapped around it
This is the first time I heard of this concept, and also thank you because replying me
If I had to choose between them two, I’d go with ContextActionService.
ContextActionService is designed for flexible, event-driven input handling. You can bind actions to keys, buttons, or touch, and easily enable/disable them contextually. It’s cleaner for game logic because it avoids constantly checking inputs every frame.
UserInputService gives raw input events and detailed info (like exact key, mouse movement, or device type), but using it directly often leads to more boilerplate and you end up managing states manually.
local ContextActionService = game:GetService("ContextActionService")
local UserInputService = game:GetService("UserInputService")
-- ContextActionService example
local function jumpAction(_, state, _)
if state == Enum.UserInputState.Begin then
print("Jump triggered via ContextActionService")
end
end
ContextActionService:BindAction("JumpAction", jumpAction, false, Enum.KeyCode.Space)
-- UserInputService example
UserInputService.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed and input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.Space then
print("Jump triggered via UserInputService")
end
end
end)
ContextActionService binds the action once and handles input states automatically.
UserInputService requires manual checks for key, state, and game processing.
Myself, I am a major fan of event-driven.