GuiService.SelectedObject behaving differently

My game relies heavily on GuiService.SelectedObject, considering how it can automatically select objects on any side.
Today the behaviour has mysteriously broken.
I am unable to move to any GUI elements that are near the SelectedObject.
I did not do anything to cause this since the last update I had published to my game was 4 days ago, and it was working fine until now.

Below was recorded in game, not in studio. I am pressing WASD and the arrow keys.

Expected behavior

I expect to be able to move to the GUI elements around the selected object.
Here is footage of when it was working

1 Like

So I’ve taken a look and noticed that the mouse just isn’t visible at all and that I can’t click on anything. Do you happen to cover the entire experience with a GuiButton to block mouse input?

Developers tend to make pop-ups, and menus using a GuiButton to block input to all objects that are below the menu. This is to prevent accidentally clicking buttons hidden by the menu. We recently made a change that allows SelectionMode to observe this same behavior. This is to prevent glitchy behavior where users would lose their selection behind foreground elements.

If that is what you do, I can recommend two alternatives:

Option 1

UserInputService.MouseBehaviour = Enum.MouseBehaviour.LockCenter 

Then just put a tiny GuiButton that blocks mouse input in the center of the screen. Or maybe just locking the mouse is enough.

Option 2

Instead of blocking mouse input entirely, set the mouse icon to what the virtual cursor typically looks like inside of Roblox. This is more of a stylistic than a behavioral choice, but is also an option.

2 Likes

Wow, that’s exactly what I did, yeah, the entire experience is covered with a GuiButton
Removing it fixes the problems.

I heavily appreciate the alternatives given. Thank you for looking into this issue!

2 Likes

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