Add whitelist or blacklisting to GetGuiObjectsAtPosition

As a Roblox developer, it would be nice to be able to specify which gui objects I want to find or ignore using GetGuiObjectsAtPosition.
I have my inventory set up in a way where multiple guis are layered on top of each other, and GetGuiObjectsAtPosition will return everything.
Example of UI layout:


Output:
ezgif-2-ee80deab080e
Addressing this issue would cut my process of having to loop through a long list of gui objects and make my work process much faster. It would also help in ignoring any GUIs that are irrelevant and does not currently need detection.

2 Likes

If you’re just changing the ZIndex of the frame to make it on top, you could check for the one with the highest ZIndex and interact with that one.

1 Like

I’ll definitely try that out. But it still wouldn’t yield the results I want, since it would still return the background image, scroll frame, and the frame encapsulating the image of the highest ZIndex. Just things I don’t want detected.

2 Likes

Yes, I agree. It should function like raycasting, but a 2D version. Complex GUI systems needn’t have all their Frames, buttons, etc., irrelevant to the query, returned by this function. The engineers could go any way with this as long as we have proper functionality, but I’d imagine we’d keep this function, while having multiple methods available for the White/Blacklist. For example, there could be one Enumeration for the function argument where we could specify which Frame or ScreenGUI to check within at the position(Procedural Whitelist?), thus saving performance.