you can’t do mouse enter or leave on surface gui. Mouse Leave and Mouse Enter are not objects of .SurfaceGui. You can call the .mouse events on one of the children that do have the event
local GUi = script.Parent
local Object = GUi.Frame --- change this to your ui child thats inside the Surface gui
Object.MouseEnter:Connect(function()
--stuff
end)
Object.MouseLeave:Connect(function()
-- stuff
end)
It needs to be a local script. But local scripts don’t run in Workspace (with the exception of being in a character). There are really 2 ways to solve this. Put the local script somewhere it does run like in starter gui or put the surface gui in starter guis and set it’s adorned to the part it should be on. This tutorial can help In-Experience UI Containers | Roblox Creator Documentation
Well at this point you’ve done everything I can think of without having access to studio myself to test. The last thing I can think to do is check that your script works in a screen gui which would rule out most script issues. But if the screen gui does work but surface doesn’t then I’m out of ideas.
Update: I made the background transparency 0 and selected “AutoButtonColor” and when I hover over it the background doesn’t turn darker as expected. For some reason the button just isn’t working at all I think.
Another update: I got the button working by moving it VERY close to the player’s face, and I have no idea why because there was never a single invisible part blocking the way of it, so I don’t know why moving it super close to the player’s face makes it responsive, but I need to figure out how to get it working from a distance.
Okay I figured it out. For some reason I couldn’t click the button because of an invisible part that was behind the players head. (Seriously it was barely touching the head) So I’m trying to figure out how to fix it.