ImageButton not registering ANY clicks

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.

1 Like

Is the transparency of the button ~= 1? Does the script run? (Just making sure the script is placed in a place it actually runs)

EDIT:
The following script works exactly as intended. Prints “Hello world” and prints whenever is is pressed.

print("Hello world!")
script.Parent.ImageButton.MouseButton1Click:Connect(function()
	print("Clicked!")
end)
ButtonProperties = {
	Active = true,
	BackgroundTransparency = 0,
	ImageTransparency = false,
	ZIndex = 1
}

The ImageButton’s transparency is 0, it’s visible because it’s a button for a user to press.

It doesn’t work at all, the script runs fine, it’s just the function does not.

1 Like

are you sure your function is actually working? it would help if you included your code

I’m very certain it is.

I’ve done it the same way as your script, printing “Hello World” runs, but trying to fire the MouseButton1Click function after does not work at all.

Your code is the same as mine so It makes no difference if I were to send mine…

The properties you sent, are the exact same as mine.

To clarify: The SurfaceGui is in StarterGui, adorneed to the part. I’ve tried to use a localscript for it and it wouldn’t fire anything.

When putting the SurfaceGui right inside the part, and using a server script I get the same result.

Here’s a quick video demonstrating…

(Line 1: local animationModule = require(script.animation)) is not the culprit, I tried to remove it and I get the same result.

1 Like

Have you tried turning on AlwaysOnTop?

AlwaysOnTop didn’t fix that, I’ve tried it and my UI overlaps over anything and it’s quite annoying.

1 Like

Players.LocalPlayer | Roblox Creator Documentation according to this, it seems like you are asking for LocalPlayer before it is available. The code example provided there is the following:

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.

This also did not fix the issue.

Here since I tried my everything best, i’ll attach an rbxl file below for you to check it out…
UI.rbxl (44.1 KB)

1 Like

I tried it out, I think yours is just cursed. Try making a copy of it and stop at each stage to make sure it still works.

I have made several copies and it wouldn’t help…

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…

1 Like

I meant recreating it rather than copying it, my bad.

Try using a different approach, put the SurfaceGui inside the part rather than putting it in starterGui and see if that works.

Also did that… it makes no difference… it’s the exact same result.

1 Like

I’ve done that aswell, I put a fresh new ImageButton and the result is the same, I don’t know why this is happening and how it has come to this.

1 Like

Alright try using MouseButton1Down Instead of MouseButton1Click, see if that works

1 Like

I tested your game, apparently you need to enable Internal’s Active property.

2 Likes

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.

The Active property is the only issue