How would I detect when any GuiObject gets selected (console)

I’m trying to make a universal selection image system for console and controller users, and I can’t find an efficient way to detect when a UI element is selected or deselected globally.

I’ve resorted to indexing through all of the descendants of the PlayerGui and attaching a SelectionGained and SelectionLost event to each of them, which I don’t think is good for performance and might hurt performance a lot.

I’ve tried looking for a global event to do these tasks; but I am yet to find one.

1 Like

Have you tried utilizing the GuiService.SelectedObjectChanged

1 Like

I can’t seem to find documentation regarding that event; could you link it?

1 Like

You should use .Changed. It fires for SelectedObject.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.