LineHandleAdornments do not consume mouse events

When clicking on a LineHandleAdornment, the game doesn’t “consume” the event, meaning events are still fired for Mouse.Button1Down and the gameConsumedEvent parameter has a false value. I’d expect them to consume events as TextButtons do.

I wrote a script to do a small repro for this bug
local Utils = require(game.ReplicatedStorage.Utils);
local Debug = Utils.new("Log", "", true);

local lha = Utils.Misc.Create{
	ClassName = "LineHandleAdornment";
	Adornee = workspace.Baseplate;
	Parent = script.Parent;
	Length = 50;
	Thickness = 20;
	AlwaysOnTop = 50;
	ZIndex = 1;
	Color3 = Color3.fromRGB(26, 210, 172 * 2); --AlwaysOnTop also has a bug where the color gets darkened by 50%, but you can assign it a Color3 value with component values greater than 255 to offset this.
};
local tb = Utils.Misc.Create{
	ClassName = "TextButton";
	Text = "This consumes events";
	Size = UDim2.new(0, 200, 0, 40);
	Position = UDim2.new(0, 40, 0, 40);
	Parent = script.Parent;
};

--Print whenever the InputBegan event is fired.

game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameConsumedEvent)
	if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
		Debug(
			"InputBegan(InputObject=%t, GameConsumedEvent=%s) fired",
			inputObject,
			gameConsumedEvent
		);
	end
end)

lha.MouseButton1Down:Connect(function()
	Debug("LineHandleAdornment Clicked");
end)
tb.MouseButton1Down:Connect(function()
	Debug("TextButton Clicked");
end)

And here is a video. What you should look for is in the output window where “GameConsumedEvent” is reported as false despite clicking on the LineHandleAdornment (and you can see that the clicked event for the LineHandleAdornment is fired).

linehandleadornment-bug.rbxl (97.1 KB)

1 Like

Bump – just ran into this again. Custom implementations of “game consumed event” are a pain; please save me.