gameProcessedEvent for all UserInputService events is meant to be true if it was processed by the engine, like when pressing an active button. However, TouchTap (and potentially others) is now returning false when InputBegan and InputEnded events are true. This has appeared as a bug in Ultimate Mining Tycoon where touch tap events for buttons are triggering actions since at least November 2nd. Others have mentioned seeing it 2 weeks before, but November 2nd is when the bug appeared.
Example code to use with a LocalScript with the device emulator active:
--!strict
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.ResetOnSpawn = false
ScreenGui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
local TextButton = Instance.new("TextButton")
TextButton.Size = UDim2.new(0, 200, 0, 200)
TextButton.Position = UDim2.new(0, 100, 0, 100)
TextButton.Parent = ScreenGui
UserInputService.InputBegan:Connect(function(Input, GameProcessedEvent)
--GameProcessedEvent is true when over the button, false otherwise.
print(`InputBegan: {Input.UserInputType} {GameProcessedEvent}`)
end)
UserInputService.InputEnded:Connect(function(Input, GameProcessedEvent)
--GameProcessedEvent is true when over the button, false otherwise.
print(`InputEnded: {Input.UserInputType} {GameProcessedEvent}`)
end)
UserInputService.TouchTap:Connect(function(_, GameProcessedEvent)
--GameProcessedEvent is always false!
print(`TouchTap: {GameProcessedEvent}`)
end)
Expected behavior
When a tap is handled by the engine for another event (button press), I expect gameProcessedEvent to be false.