This function takes a screen position and returns a list of all the visible
GuiObject|GuiObjects that are occupying that screen position.
The main use case is to get GUI objects under the player’s
Player/Mouse or touch inputs to do things like allow selection or highlighting. These effects can already be achieved using
GuiObject/MouseLeave but this requires the developer to track these events for their UI objects all the time even if they only need this functionality in specific circumstances.
Since the child classes of
BasePlayerGui inherit this function, it can be fired by class objects such as the
The x position on the screen relative to the top left corner after the
The y position on the screen relative to the top left corner after the
A table of the visible
Selecting GUIs at a Position
All GUIs returned by GetGuiObjectsAtPosition() at ‘cloned’ by the highlighAsFrame() local function which creates a
Frame GUI positioned on top of the specified GUI that is semi-transparent and the same
These highlights are added to the HighlightsContainer
ScreenGui in the Highlight folder of the player’s PlayerGui folder. Both are created by the code sample. All highlight GUIs are
Instance/Remove|Removed when every time highlightGui() executes.
Note that HighlightContainer’s
ScreenGui/DisplayOrder is 99999, a large number, so that it is unlikely any other GUI will render on top of the higlight GUIs.