The user can click over a frame, how can I make it so the user cannot click when a frame is over the button?

Dear DevForum community,

I found a bug that can cause people to accidentally buy stuff in my game without their knowledge.
So when the user clicks on a button when there is a frame over the button, it still activates. This is so weird considering I have large portfolio in SwiftUI.

How do I fix this in Roblox:

Thanks in advance.

1 Like

disable it maybe? or can you not do that because the first frame is needed for the second frame to show up?

2 Likes

Is it possible to make it not clickable without disabling it? I know it can be an easy fix, but I just want to see if there is something I didn’t know about.

1 Like
2 Likes

That’s just disabling it. I was expecting a property on a frame to possibly override the button’s priority or something like that.

1 Like

Thats probably your best bet. I was thinking like checking your Zindex or making sure your UI frame was above the ones with the Buttons in it or something.

1 Like

No, there isn’t then.

I tried all methods and the only one that works is by either setting visibility to false or setting interactable to false.

2 Likes

What I ended up doing is make a property in my script called

local canPurchaseRootCharacter = true

And if the skins frame is opened, I set this to false.

With the actual get button, I added this:

if not canPurchaseRootCharacter then return end

If there is a property in the frame that overrides the Button’s priority, lmk and I would much rather use that. Its kind of weird that Roblox doesn’t have a property like this.

2 Likes

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