Buttons can be clicked when a frame is over that button

Well, heres an idea. You could just do the math to check if the players mouse is over the frame when they click the button.

Shouldn’t you simply change the zindex of the button & frame. And it should respect the order. Also I’m not sure but I think you swapped around the active properties.

I suggested using GetGuiObjectsAtPosition to do this in a post above. It’s a bit hacky, but would work if you can’t find any other solution.

I mean thats even better then my math suggestion. The only alternative is just making the button invisible with the frame out.

1 Like

I have the ZIndex of the frame in 9999.

Hey, I know this post is a bit old, but I was running into the same problem just now and saw this post does not have a solution designated.

I was able to solve the problem by replacing my frame with a TextButton that didn’t do anything and with its AutoButtonColor to false to help sell the effect. Also, the Selectable property of the covering TextButton “frame” should be set to false if controller support is a concern.

It should be noted, however, that while this did successfully block mouse clicks, it did not prevent hover events (MouseEntered, MouseLeave, or AutoButtonColor) from triggering. Also, the cursor does change to the “button hover” cursor when inside the TextButton, which, while it makes sense that that would happen, may not be desired.

8 Likes