My ImageButtons are not detecting any input when clicking on it, even with printing something when clicking on it. The MouseClick signal does not fire at all.
My button is inside a SurfaceGui, which is in the PlayerGui adorneed to the part, the local script is what is supposed to fire the function.
I’ve tested this on a seperate part with a fresh new ImageButton, because I was going crazy for the past 4 hours thinking it’s my own problem when I realized this issue affected a fresh new inserted ImageButton.
Can anyone reproduce this?
My scripting is not the problem as previous work, with ImageButtons works fine, attempting to copy and paste it breaks it the same way I face at the moment.
Before you tell me:
ZIndex is at the highest possible (As an example).
The script is enabled.
The ImageButton Property “Active” is true.
My friend attempted to do the same and faces the same issue with them not being able to detect clicks.
local Players = game:GetService("Players")
-- Below: access Players.LocalPlayer; if it is nil, we'll wait for it using GetPropertyChangedSignal.
local player = Players.LocalPlayer or Players:GetPropertyChangedSignal("LocalPlayer"):wait()
Try doing this instead of accessing the LocalPlayer instantly. The following is also stated: “Doing this isn’t for a LocalScript within StarterGui, StarterPlayerScripts or StarterCharacterScripts: these scripts can only run after a Player object is already available, and LocalPlayer will have been set by then.”
The absence of ReplicatedFirst indicates you may need to do this in order to make sure LocalPlayer actually is available.
Because I have one old UI on a surfacegui that works… you can click on it but once i start duplicating it and paste in the new UI it wouldn’t work at all…
I’ve tested this on multiple places.
My ImageButton is “Selection” and is a “ImageButton” (No image set), but I’ve also tested this with a simple “Selection”.
I’m using the latest version of Studio as of writing this.
Please test this and see if it’s a general issue for you too, because I’m going crazy.
This is a known issue, and is happening because of Build 2.0.0. It is being fixed.