Clicking TextButton Wont Work In A SurfaceGui

Yo so I have a TextButton inside a frame inside a SurfaceGui and I attached a print statement to the button when it’s activated, but when I click the button it won’t print. Visually the button highlights and looks like it’s being clicked.

I’ve read a few posts about this, I’ve followed solutions like making the surface gui a descendant of startergui / playergui and setting the adornee, but that also won’t work.

Thanks for any help

1 Like

Make sure you’re using a LocalScript within the SurfaceGui in StarterGui

Are you using a localscript? Server scripts tend to break when used in surface GUIs.

This might sound obvious but make sure the button is enabled. I once spent an hour trying to debug a very similar problem and turned out the button was not enabled. Also make sure you are using a LocalScript.

1 Like

It’s a local script that’s a descendant of StarterPlayerScripts

I tried parenting the local script to both StarterPlayerScripts and StarterGui

The button was NOT active, thanks it works now

1 Like

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