I’m trying to handle all of my game’s input from sprinting, dashing, skill usage, etc.
Any help would be useful.
I’m trying to handle all of my game’s input from sprinting, dashing, skill usage, etc.
Any help would be useful.
Local Scripts and Module Scripts.
If you just want a system that is all in one script, you could use a single local script in ReplicatedFirst
I would suggest using modules to do most of the work and only use a central local script to initialize the modules and/or sense inputs like key presses
By having all these scripts and modules connected you can easily pass values like a sprinting boolean when programming more complicated movement, though most of it is up to you there isn’t a best way to do it.
I did the state handling in a script by making a table for each player in the game that would look like the table below and adding it to a module table with their name as the key for indexing
{
blocking: boolean,
sprinting: boolean,
etc...
}
I wanted to respond to this to ask if it would be efficient to go about handling input the module way as you said like
userinputservice.InputBegan:connect(function(input)
someHandlerModule[input]()
end)