None of the input events for surface guis are working for me

I have been trying to create a button with a SurfaceGuis and an image button. I have tried using MouseButton1Down, MouseButton1Click, TouchTap ( This button is going to be on mobile. ), and InputBegan.

None of these events are working for SurfaceGuis.

To test it, I have put a local script with the code below inside a local part cloned from replicated storage. This doesn’t print anything, regardless of the event type.

I have tried it both testing regularly, and using the emulator for the mobile event.

Screen Shot 2020-04-11 at 8.48.56 PM

My image button is active. I am not sure what I am doing wrong here. Can anyone provide any insight?

EDIT: To clarify, there are no errors.

Make sure to have SurfaceGui to ‘AlwaysOnTop’ to true, this could should work so, also, you’re on a place utorecovery!

1 Like

Thanks for the suggestion, though setting to AlwaysOnTop didn’t work. It should work with it set to false though, that is expected behavior.

Try something, on button go to AutoButtonColor and set it to true, to see if it’s detecting mouse, maybe a part is blocking it tho.

You say you clone it but where are you parenting it after you clone it?

I am cloning and parenting it to the workspace.

Local scripts only work in these make sure the script is located in one of these.

  • A Player’s Backpack , such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts .
  • The ReplicatedFirst service

Ah, good catch. Thanks for that. I thought it would work if it was created locally.