I expect GetGuiObjectsAtPosition to only return GuiObjects that are Visible and under a GUI that is enabled
Actual Behavior
GetGuiObjectsAtPosition returns GuiObjects that are Visible and under a GUI that is disabled
Code
local Players = game:GetService("Players")
local localPlayer: Player = Players.LocalPlayer
local playerGui: PlayerGui = localPlayer and localPlayer.PlayerGui
local mouse: PlayerMouse = localPlayer and localPlayer:GetMouse()
local GUI = script.Parent
local Frame = GUI.Frame
mouse.Button1Down:Connect(function()
print(playerGui:GetGuiObjectsAtPosition(mouse.X, mouse.Y))
print("Frame.Visible", Frame.Visible)
print("GUI.Enabled", GUI.Enabled)
end)
Issue Area: Engine Issue Type: Other Impact: High Frequency: Constantly Date First Experienced: 2022-01-01 00:01:00 (+07:00) Date Last Experienced: 2022-09-20 00:09:00 (+07:00)
I’m able to reproduce the results you’re seeing. However, changing the API isn’t an option right now. My suggestion would be to check the parent of the current object recursively until you get the GUI it’s under and check if it’s Enabled.