Button activates when clicking on it from another frame that is on top of it (higher on the ZIndex)?

problem.rbxm (6.8 KB)

How do I make it so the button doesn’t activate when I click on a blank space on the second frame?

Do I need to make a script so that doesn’t happen or is there a property I can change or a setting?

I’ve searched for a solution but none of them seemed to have helped me.

I haven’t found a direct solution to this, to begin with…

Do you need the frame underneath to be visible?
Visible = false makes it stop interacting

Hey! So there was a similar post created here: How to make Gui Instances under another Gui Instance NOT Clickable? - #10 by Anaminus

I don’t think it’s possible without using scripting. I know of a few methods to fix your problem.

The easiest one would just be make the buttons invisible when the frame is activated. Another way to do this if you want to keep the frames visible is to keep a table of bools which has the values of which buttons can be clicked or not.

local buttons = {
  'Shop' = true;
  'Exit' = true;
}

shopButton.MouseButton1Click:Connect(function()
      if buttons['Shop'] then
          -- tween frame and make it so the other buttons are set to false in the table
      end
end)

Another method could be using connections and just disconnecting them and you could also detect if a frame is in bounds of a certain button and then have that button disconnected and then if the frame is closed reconnect it.

1 Like

Yep, I just thought there was another way…

I see… I had that in my mind yesterday but I didn’t know how to do that exactly. I guess making a table would be best and good for me because I have little experience with tables so far.

Well, thank you, I appreciate it. For some reason, I thought there was a simple property or setting I didn’t see, well it was around 4 AM when I posted this, I surely didn’t think straight…

Anyone who also has the same problem as me would hopefully find this answer and solve his/her problem.