Hello all! I made a quick little script to help me out with handling player inputs.
I’ve always been annoyed with how much boilerplate code goes into handling player inputs with UserInputService, so I created a ModuleScript that allows me to create bindable events linked to player inputs that I can then listen for in order to clean up my code.
You can read all about how to use it and copy the code on my github repo.
Current limitations:
Keyboard only
Uses InputBegan only
Cannot link multiple inputs to one event (I’ll be adding support for these features as I need them. Feel free to submit a PR though!)
I often find myself having a function connected to UserInputService.InputBegan that makes sense of the input and invokes the correct function. This gets messy when I have over 12 binds, or have to do it in multiple scripts. Using BindableEvents in this way allows me to clean up some of that mess.