Help with model click detector

I am trying to delete an object when a user clicks on such object, but I am recieving no information that a click has been registered by the user (Via the prints) and the model is not deleted. According to the documentation this should be possible. I have had other users test this out also but they also had no luck. Is this a bug or can it not be done?

Model in question:
image

script:

script.Parent.ClickDetector.MouseClick:Connect(function()
    print("Attempting to delete...")
    script.Parent:Destroy()
    print("Failed to delete!")
end)

You can’t click a model, so you’d have to insert the clickDetector into a part inside that model, and make it destroy it.

1 Like

According to ClickDetector | Documentation - Roblox Creator Hub (“They work when parented to BasePart , Model or Folder objects.”) it should function. Hovering over the object does register that it is clickable but it refuses to register any clicks.

Have you checked the output for any errors? I set up a model with a ClickDetector and your script, and it worked fine for me. Does the script have anything else in it?

There is nothing inside of the script, I will try it again incase it was a one off

1 Like

It seems to be printing and destroying for me. You may need to double check your set up a couple times.

script.Parent.ClickDetector.MouseClick:Connect(function()
print("Hi")
wait(5)
script.Parent:Destroy()
end)

image

1 Like