userInputService.InputBegan:Connect(function(input)
print(input.KeyCode)
end
Sometimes when Studio starts, it works for O. Other times, nothing happens when I press O. I’ve yet to experience this issue occurring in an actual server.
Engine bug I’m guessing, as usual. But, I don’t really know.
In the past, the O and I was assigned for zooming out and in, most likely to accommodate the laptop users. You could test if Enum.KeyCode.I also experience the same issue or not. If it doesn’t, it’s probably just that key that is overridden by something such as the use of ContextActionService(don’t know if key presses have certain priorities).
The piece of code in the OP will print any time UserInputService captures input from an input device, so it should print any time input is passed. The issue OP is facing is that when they press O it’s not getting registered by UserInputService so there’s no print available.
Your if statement would only cause the subsequent instruction to execute if the KeyCode is O but that’s not the root of the problem here. OP expects a print when O is pressed and it doesn’t happen; they aren’t trying to make a system that only invokes when O is pressed.