How do I make UI buttons disabled/unselectable?

I am trying to make a spawn point selector UI for my game, with a couple of spawn locations locked. I want the locked spawn locations to have a unselectable UI, that you cant hover over and click on etc.
I tried disabling the UI Button and making it unselectable but it still does not work. Can anyone help me with this?

Pretty sure there is a property in every textbutton / imagebutton named .Enabled.
You can just change that property to false whenever the player isnt able to spawn at the desired location.

After research, there is no .Enabled, but there is a .Visible. What you can do is have a frame that has the shape of the spawnButton, then place the button inside of it. Whenever the player cannot spawn, just turn the .Visible to false and then the generic frame will be under it.

The .Visible property disables the button and hides it.

I tried that but it didn’t work.

This works, but it is kinda too messy

I mean its pretty much the only possible way. What do you mean by messy?
This method can work really good. Just place the appearence of what the button should look like in the frame, then add the selectable button over it. Then all you have to do is change the .Visible of the button and everything should work well.

Alright, I guess this is the only solution

Couldn’t you set .Active to false and, in your script, check if active is enabled when the button is clicked?

If you don’t want hover effects, also set AutoButtonColor to false.

3 Likes

What about Active? Setting it to false disables input.

But… it doesn’t work for keyboard nav

I don’t think you can do anything about keyboard nav.

Edit: Maybe these’ll help you

I simply ignore inputs if Active is false.

Oh, you WANT it to work. I guess you could create a custom property then and use that instead of .Active

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