GetGuiObjectsAtPosition() doesn't include objects that the mouse enters the lower half of

When I use BasePlayerGui:GetGuiObjectsAtPosition(), it does not return a Frame that the mouse entered the lower half of.

Repro1.rbxl (182.7 KB)

In the attached place:

  1. There is a ScreenGui with a white Frame.
  2. It contains a script that will print the count of GetGuiObjectsAtPosition() when the frame is hovered.
  3. It prints 1 when you start hovering over the top half of the Frame (:smiley:)
  4. It prints 0 when you start hovering over the bottom half of the Frame (:frowning:)

Expected behavior

I expect GetGuiObjectsAtPosition() to return the Frame no matter what half of it you start hovering over (it should always print Hovered guis: 1 while hovering the Frame.

(Repro doesnโ€™t include this but the bug persists even if you use the latest MouseMovement InputChanged position and the mouse is anywhere in the Frame after entering from the bottom half)

This probably has to do with the topbar inset. Cant test it myself right now though.

2 Likes

Thatโ€™s it thanks.

Solution is to always subtract inset from the mouse position (regardless of IgnoreGuiInset value).