The Active property of GUIs is described on the wiki to disable all input from the gui (MouseUp/Down/Click events etc.) when it’s set to false. The wiki also acknowledges thatt it doesn’t work.
My issue is that it’s been like this for years, is there a reason for it not working? Or has it just laid unnoticed?
I noticed this when making a level based single player game a few years ago. If I wanted to lock players from playing a level they hadn’t unlocked, setting the buttons Active property to false didn’t do anything and I had to find a workaround.
The wiki does state this though, so it should really be fixed. (It’s been broken for ageeees)
This property currently does not work as expected for most GUI objects.
(Therefore this thread is probably better off in Client Bugs rather than features?)
Right thanks for the suggestion moved it.
Yea, several projects I’ve wanted to use it but been disappointed every time it hasn’t been fixed yet. In my current project I want to use it to temporarily disable and visible textbuttons while a notice/pop-up is on-screen so that players cant bug things out.
Add more information to this report, which GUI objects and input events are you using and what is the unexpected behavior that you are seeing?
A small repro file would be perfect for a bug report like this
What kind of repro? The property simply does nothing and it’s also mentioned on the wiki that it doesn’t.
Is it necessary to add a repro of like events connected to a textbutton or something with Active set to false to prove it does nothing?
Sorry, a little new to bug reports
Oh, I thought you only meant in certain situations, never mind.
Yea, sorry, it’s my fault, the original post was a bit vague before I edited it.
It doesn’t work as expected because it doesn’t do what you think it does.
Active determines whether mouse events fall through to 3D space. Observe:
According to this demonstration, Active is still working as intended.
Are you sure? The name of the property doesn’t seem appropriate for the behavior you claim. Additionally, there seems to be a lot of exceptions to the property which makes me think it might have been unintended behavior.
It makes sense that this would be the correct behaviour, despite the poor choice of name which has seemingly led to confusion even amongst the wiki writers it would seem (hence the “this doesn’t work as expected”)
I’ve created a feature request that would solve the problem we have both had.
Yeah @SheikhGoat, my understanding was that Active being on just stops input from falling through by “sinking” it. It seems like there should be a way to stop buttons and textboxes from working…
Sorry to bump this, but:
In my game, I have a model dragger which works fine on mobile, however when the GUI is clicked (to place it for example), the model will just jump to the mouse.
I thought having Active set to true would fix this but it looks like it doesn’t. Is this intended? is there another way of doing this?
Thanks.
If you’re using the UserInputService, you’ll see events regardless of whether a gui “consumed” them. Some of the events have a second argument, gameConsumedEvent (or something like that), which is true when, for example, a button was clicked. Can you verify that gameConsumedEvent is passed as false to your script?
If it isn’t false, well, you know how to fix it.
function onInputBegan(inputObject, gameConsumedEvent)
if gameConsumedEvent then return; end
...
OK, thanks!
Edit: Fixed it! Thank you very much for yoru help
This is still a relevant issue; the behavior is vastly different for mobile devices compared to PC!
Example 1
Clicking on a TextButton with active set to false on a mobile device will not register, however on PC it will.
Example 2
Any GuiObject parented to a ScrollingFrame with active set to true will prevent players on mobile devices from being able to scroll if they initially place their finger on the GuiObject, while scrolling with a mouse on PC works just fine.
Due to these behavior inconsistencies, it’s difficult to catch which state the active property is set to when making UI as you won’t notice any of these issues before testing on a mobile device or in an emulation.