Certain controller buttons "gameProcessedEvent" always true

game:GetService("UserInputService").InputBegan:Connect(function(input, gp)
	if input.UserInputType == Enum.UserInputType.Gamepad1 then
		
		print(input.KeyCode)
		print(gp)
		
	end
end)

“gp” is always true no matter what for some buttons like “Enum.KeyCode.ButtonA” and “Enum.KeyCode.ButtonR3”, as far as I know these are the only two buttons, but I haven’t checked all of them. This is a problem as I’m using these two buttons for actions in my game, I can bypass this by not checking if “gameProcessedEvent” is false, but if I don’t then when the player presses things in a gui the action will run.

The A button is connected to jumping and the ButtonR3 is used to toggle first person mode. Button selection should be possible regardless for the currently selected button though, it should fire MouseButton1Down on that button. If you are not using conventional selection / UI buttons, you’ll have to override input using ContextActionService::BindActionAtPriority.

I see, but wouldn’t using “ContextActionService:BindActionAtPriority” make my action still play when the player is in a menu?

I assume you mean “isn’t”? Either way, you bind the action when you need to start receiving input, and you unbind the action when it is no longer relevant using ContextActionService::UnbindAction. In other words, you’d bind an action when the menu opens, and unbind it when that menu closes so the player can jump / toggle first person view again.

No, I need it to work when the player is outside of a menu, what I’m doing is if the player holds down spacebar or the A button on their controller they start flying, but if they tap it they can still jump.

Look into ContextActionService API. It can do all of those things, you just need to layer several bindings with different priorities.

Still having this issue with the A button. Not getting that with the R3 though (probably because I’m using a Scriptable Camera). Anyone find a solution to this?