Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Clicking a text button causes the gui behind it to overlap it?

I have made a little shop button which is simple and opens a frame to buy things but the thing is I whenever I click the button in-game the image behind it overlaps it so I can't click it anymore. Everything is completely perfect except for that.

I have tried to do LayoutOrder which I think means layers, I put on the button's order 1 and the image's order is 0.

First I suspected it was just changing my text whenever I click it but then I looked in my PlayerGui and it showed that the text button was behind the image label. I also tried to fiddle with parent hierarchy and that didn't work to.

I am using the Roundify plugin which rounds gui's corners to make them look better with an image but that image is overlapping my text button.

Here's part of my script responsible for opening the shop:

local function OpenShop() -- ShopFrame is a completely different frame in another ScreenGui
	if ShopFrame.Visible == false then
		ShopFrame.Visible = true 
	else
		ShopOpenButton.Visible = false
	end
end

ShopOpenButton.MouseButton1Click:Connect(OpenShop)

If you can tell me more possible solutions or an alternative please let me know!! thanks for reading.

15 comments

0

Could you edit your question and show us some code, maybe you're doing something that could cause the layout to move into the wrong order

0

I'm not sure what piece though? The clicking it? or something else?

0

All I have is variables and those lines for the script.

1

Try changing the z layer or z index on the GUI (forgot what it’s called)

0

Thanks I will go try it now!

0

Should I change it for the Textbutton or the Roundified image which is overlapping the button?

0

Increase the value for whatever you want in front

0

I’m honestly not super good at guis, just think this might help

0

I’m honestly not super good at guis, just think this might help

0

I increased the textbutton's z index but that didn't work and I increased the image's z index and that didn't work :(

0

Hmm... this problem is difficult to track down

0

Hmm... this problem is difficult to track down

0

Is it possible the button goes down a layer when it is pressed?

0

I'll check

0

Nope the button doesn't go down a layer and the Image doesn't go down or up a layer

1 answer

make sure the text button Z Index is higher

1 comment

0

I did it the text button z index is 1 but the image's z index is 0

This discussion is preserved as it was. New answers, comments, and votes are closed.