Been struggling for a while to get this to work. Got a simple UI, Adornee is set to a part, it only works when AlwaysOnTop is on but I don’t want it getting in front of the entire map. What is going on here??? Tried everything
script.Parent.TextButton.MouseButton1Click:Connect(function()
print('E') -- DONT PRINT
end)
To my knowledge, to detect a click from a client on a SurfaceGui, you need to move the SurfaceGui in the StarterGui (or PlayerGui in game) service and Adornee it to the part, then do your functions.
Yes it already is parented to PlayerGui, and it’s adornee is the part. I think the part is somehow interfering with the detection as it works when AlwaysOnTop is on
I’ve tried changing various properties, but I can’t replicate your issue. It seems to be working fine for me regardless if AlwaysOnTop is true or false. Can you show us the properties of the TextButton? And is there another GUI that might be conflicting with it? If so, try disabling it and see if you’re still having this problem.
Interesting it’s not the properties of the SurfaceGui. I tried in an empty place and it worked fine. I did some fishing around in other scripts and discovered that one of my ContextActionService:BindAction() actions somehow blocked the input. I’m just using UserInputService.InputBegan now and it works fine. Never knew this was a thing
PS: It’s not the content of the OnPlayerClick function either, as even when I connect the action with an empty function it will still block the SurfaceGui from detecting any input