UI button still being selected even though it's not visible with controller

Hey, so I’m having a weird problem, as you can see here:

As you can see, I press the level select button, and it then hides the frame. However, if I press the button on my controller to open up the UI select, it still has the selection around the frame that is no longer visible…

Any idea? Thanks :slight_smile:

2 Likes

You could try using a bool variable that is true if your level is loaded and false if you are picking a level. Then when you get your input, only run the code if the variable is false: “if variable == false then” and run all the code for selecting the level and frame work after. I tend to go with that option but there might be better. (Don’t forget time set it to true after you pick a level and back to false once complete or whatever)

1 Like

This is completely roblox built-in behavior; I haven’t modified anything to work according to my UI.

:confused:

1 Like

Hmm. How are you detecting UserInput. I’d assume UserInputService or ContextActionBind(I don’t know what it’s actually called whoops)?

My only thought is to move the frame out of the GUI so it is no longer rendered or even considered by the roblox selector. If that doesn’t even work, there’s probably nothing that you can do. Worst case scenario you run LoadCharacter on them before tping into the map in order to reset their GUI.

1 Like

Looks like you’re simply not cleaning up the closing of your menu. Such as:
UserInputService Disconnect()s and

GuiService:
.SelectedObject = nil
-- and possibly:
.GuiNavigationEnabled = false
:RemoveSelectionGroup( "YourMenu" )
-- etc.
1 Like