I have been trying to add gamepad support to my train’s movement system but it wont listen to any input that I put in, keyboard inputs work just fine
The relevant lines are as follows:
The Listener
ContextActionService:BindAction("IncreaseLever1", ActionHandler, false, _Tune.Keybinds.Keyboard.IncreaseLever1, _Tune.Keybinds.Gamepad.IncreaseLever1)
(ActionHandler is merely just a function to bridge input names to other functions)
The code that actually processes IncreaseLever1
ContextActions.IncreaseLever1 = function(inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
CALocks.IncreaseLever1 = true
while UserInputService:IsKeyDown(inputObject.KeyCode) == true and ThrottleNotch < _Tune.Lever1Notches do
local Clamp = (IsCombinedLever == true and -_Tune.Lever2Notches) or 0
ThrottleNotch = math.clamp(ThrottleNotch + 1, Clamp, _Tune.Lever1Notches)
SetTargets(IsCombinedLever)
wait(0.2)
end
CALocks.IncreaseLever1 = nil
end
end