ReactiveInput - Input Binding Made Simple

Intro

Introducing ReactiveInput: Input made simple. This module is meant to make adding button controls to your game simple and easy. Right now, it only supports keys, but in the future, we will add mobile buttons, and clicks.

API

Reactive Input:

Properties:

LoadedReactions: { Reaction },
InputConnection: RBXScriptConnection,
CoreRemote: RemoteEvent,

Methods:

AddReaction: (self: ReactiveInput, Player: Player, Name: string, Keybind: Enum.KeyCode) -> Reaction,

Adds an reaction to the manager, and returns an Reaction Object

ReferenceManager(): ReactiveInput

Gets the Input Manager that is running, works on both server and client.

Reaction

Properties:

Name: string,
Key: Enum.KeyCode,
CoreRemote: RemoteEvent,
CallbackList: { (Parameters: {}) -> nil },
ReactConnection: RBXScriptConnection,
Player:Player,

Methods:

AddCallback: (self: Reaction, callbackList: { (Parameters: {}) -> nil }) -> nil,

Adds an callback to be ran when the reaction is activated. Can be a table, containing a list of functions to be ran.

Bind: (self: Reaction, Parameters: {}) -> nil,

Binds the Reaction, activating it, and allows it to pick up on input.

Unbind: (self: Reaction, Parameters: {}) -> nil,

Unbinds the reaction, deactivating it.

ReactiveInput.rbxm (2.6 KB)

The Server will need to create a reactiveinput object, and the client will also need to create a reactiveinput object, for this to function.

Update 1.1

  • fixed bug where :Unbind() would not function under some circumstances
2 Likes