I am studying game development using Roblox Studio in the military.
And sadly, gamepads are not allowed into military base.
I have to test my game is it working well with gamepad.
So I’m trying to create a plug-in UI to replace the gamepad, but I’ve run into a problem.
I’m looking for a way to force the Connect() function to run.
game:GetService("UserInputService").InputBegan:Connect(function(InputObject, gameProcessedEvent)
print(InputObject.KeyCode) -- i wanna let this print ▶ Enum.KeyCode.ButtonA
end)
Why don’t you doprint(Enum.KeyCode.ButtonA)?
No! never! It would take too long to test like this. Moreover, when testing like this, the test results cannot be trusted.
Very sadly InputBegan:Fire() does not exist.
function game:GetService("UserInputService").InputBegan:Connect(Func)
Func()
end
i mean i have no gamepad but wanna let it print Enum.KeyCode.ButtonA
the buttonA is gamepad button A.
With those three unmodified lines, it is impossible to print Enum.KeyCode.ButtonA using keyboard alone.
BUT i wanna print Enum.KeyCode.ButtonA using keyboard alone with those three unmodified lines.
This sounds impossible, but that’s why I’m asking.
I need this method too lol but I did see a resource a couple days ago called “InputService2” which basically just uses the Roblox player modules to fire events.
Haven’t tested it myself but it seems like it works
It allows you to uhh fire inputs and do some other stuff