Click Detector Not Firing!

Alright, I have a click detector inside an anchored part. When I hover over the part the cursor changes but the script I wrote doesn’t work. So I made a very simple script (Screenshot below) which prints something when the mouse is clicked

But it doesn’t print anything:

Try adding an indent to the print statement

1 Like

Nothing wrong with the code. I tried it and it printed nil like expected. Maybe try to bring down Studio and try again?

Put the script inside the ClickDetector, and change the code to this:

local detector = script.Parent

detector.MouseClick:Connect(function()
	-- code here
end)
1 Like

Code is fine and it should work.

Very strange behavior, I remember having problems with ClickDetectors a while back but it is working for me now.

Restart studio is only advice

I just tried removing all starterCharacterScripts and it worked, I found a script that was negating me from interaction with objects (It was the one free model) I forgot about it and didn’t even think that it could be causing this. Thanks to everyone who helped!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.