How can I skip over a text label?

Hello, I’m trying to make a button, but since the button is a image button I put a text label over it. But, since the text label is over the text button the script doesn’t think there is a button under it, so there is not detection. How can I fix this?

Thank you in advance.

You can parent the text label inside the button, or you can set the Zindex to prioritize the button over the label. So, you’d set the Zindex of the text to 2 and it would ignore the text label when layered.

So I parented the text label inside he button and put the zindex of the button to 2, but it still doesn’t register…

You’d set the Zindex of the button to 1.

1 Like

Same result…any other idea why this is happening?

1 Like

Can you show a picture?

Try printing something when clicking the button. If that doesn’t work, then it would have be something to do with the UI layering.

1 Like

I added prints before and didn’t work here’s a game file if you have time.
Baseplate.rbxl (36.7 KB)

1 Like

I added a localscript to it and it seems to work properly. I also changed both Zindex back to 1.

Since it is an ImageButton, there will be no visual changes until you add an image. So, if you want to visually see it change, you’d have to add an image or convert it to a TextButton. You can use this plugin to convert it without deleting it:

I tested out your button with a localscript and it’s working fine.
Here’s the script that I added to the ScreenGui:

script.Parent.ShopButton.MouseButton1Click:Connect(function()
	print("OK")
end)

Are you looking to see it do something specifically, like an animation or connect it to a script? Otherwise, the button works completely fine.

2 Likes