InputBegan/InputChanged/InputEnded events on GuiObjects parented to SurfaceGui return input.Position offset by the screen's GuiInset

  1. Place a part in the workspace and insert a SurfaceGui with a GuiObject at the position of (0, 0)
  2. Place a locally executed script in the said GuiObject with the following code:
script.Parent.InputChanged:Connect(function(input)
	print(input.Position)
end)
  1. Run the place and place the mouse in the top left corner of the part.

Expected result: the printed input.Position is roughly (0, 0, 0)
Actual result: the printed input.Position is (0, -number, 0), where:

number = game:GetService("GuiService"):GetGuiInset().Y

This should not be happening on a SurfaceGui, as the GuiInset is not applicable to that type of instances.

1 Like

This was an incredibly annoying issue to pin down - I’ve been figuratively bashing my head against a wall for well over two hours at this point wondering why the cursor I’m drawing on a terminal display wasn’t aligned with the actual cursor, thinking I’d messed up somehow.

I can’t just offset it by the GuiInset again, because it’ll just break in the opposite direction if or when this gets fixed, so my options are either to wait or to write my own function to compute the position of the cursor on the SurfaceGui.

Thanks for reporting this, you probably saved me a dozen hours more.