GuiObject 'Enabled' property

Following on from this thread… Active property of GUIs not working
Now that the property (poorly) named Active has had its behaviour cleared up after so long, this now means that there isn’t even a broken property that allows us to disable input on a GuiObject.

Therefore I suggest a new property/behaviour called “Enabled”

Why this is needed
Often, you may find that you want to disable a button that the player shouldn’t be able to click yet, but may in future.
Such examples of this include:

  • In a level based game, you may want the player to only click on unlocked levels, and disable click events on other buttons.
  • Items in a simple crafting system that you don’t want people clicking if they haven’t unlocked them yet.
  • Anything where a button may be clickable in future, but you don’t want generating events now (usually because it would otherwise involve extra code to prevent the player from activating something they can’t)

Usage
Would be used with any TextButton, ImageButton and potentially even TextBox.
The issue with communicating that the button/textbox is locked on purpose (to avoid bad UX) would be up to the developer.

TextButton.Enabled = false

With this, any input events would be ignored. Any functions listening for mouse events wouldn’t be activated.


Its not the biggest problem in the world because it has a relatively simple but often ‘hacky’ way to get around. It would be a nice property to have. Especially as a lot of people (myself included) probably think/thought that .Active was supposed to do this already.

9 Likes

Confusing name because SurfaceGui/etc have an “Enabled” property which does the same thing as Visible. I’m not sure what better naming would be, but it’d be great if we could come up with something else.

Hmm I can see how this could be a problem but I’m unsure of what to suggest as a better name. Unlike Active, Enabled would actually describe what it does pretty well. :confused:

Interactivew, InputEnabled etc. I’m sure they can think of something it’s just the functionality that I want

InputEnabled is a good shout, but you’re right; the functionality such a property would bring is whats really needed.