What's the difference between ContextActionService and UserInputService?

CAS = ContextActionService
UIS = UserInputService

Hello developers,

I was working lately with player input and keybinds and was wondering, what’s the difference between CAS and UIS? and which one is better to use at which cases?

they work the same way from what I’ve seen.

4 Likes

ContextActionService essentially puts context into UserInputService, this means it is easier to bind and unbind your actions if you use ContextActionService under conditions as you can do specific keys much easier. ContextActionService is also used for when you want actions to be enabled under certain conditions or time frames. You can read more about this in the documentation for it here.

An example is a door in a prison game, when a player is not a prisoner you might want them to have a bind to open the cell door - but when they are a prisoner we might want to remove that bind.

UserInputService is used more frequently from what I know, its a less advanced form of ContextActionService in that you’ll have events such as InputBegan and InputEnded which are useful in some cases. Whereas the action service will latch onto specific keys easily.

It all depends on the behavior you want to achieve.

43 Likes

Thank you for the clearification, really appreciate it.

6 Likes