Cannot interact at all with the click detector

the detectors do get created, but i cannot seem to click them. fixed camera, cursors doesn’t change. Yes, they are connected to smth but that doesn’t matter since i cannot even click them. Is this some sort of collision thing? (tested another angle, same issue
also it worked before the CursorIcon thing but removing it doesn’t change anything
even made the hitboxes bigger!
code:

game.ReplicatedStorage.HitboxRemote.OnServerEvent:Once(function()
	workspace.CreatedDetectors.Value = true
	for _, hitboxes in pairs (workspace.Hitbox:GetChildren()) do
		local click = Instance.new("ClickDetector", hitboxes)
		click.MaxActivationDistance = math.huge
		click.CursorIcon = 9171211297
	end
end)

screenshot:
image
also get out your HAHA PVZ already

1 Like

Are you adding the hitboxes in code? Is that why you don’t just put a click detector into them in studio? If you can’t put them in with studio your next option is to put a ClickDetector into ReplicatedStorage with the values you want and then clone it in your code instead of creating one. So:

game.ReplicatedStorage.HitboxRemote.OnServerEvent:Once(function()
	workspace.CreatedDetectors.Value = true
	for _, hitboxes in pairs (workspace.Hitbox:GetChildren()) do
		local click = game:GetService("ReplicatedStorage").ClickDetector:Clone()
        click.Parent = hitboxes
	end
end)

What I just gave you will work. I tested it.

1 Like

but the thing is mine do get created i cannot click them. now that i think about it it’s weird i cannot click them at any angle at all. sounds like an engine issue now that i think about it

Yes I had that same issue when I just added 3 parts and did your code to add them. So that is why I did the other method and it worked correctly. Do what you want but I was just giving you a working solution.

i am testing rn… doesn’t work… no like the cursor doesn’t even change it’s irritating


also ignore the funny little guy lol

IT WORKED FOR LITERALLY ONE SECOND. THE CURSOR CHANGED wowwwwwwwwww

Just make sure your hitboxes are above all other parts also. If something else is blocking them it wouldn’t pick them up either.

i did. i tried a bunch of things.
image

If you could make a small project that exhibits this and post the roblox file I could take a look. Otherwise maybe you can try removing all other parts and non essential things and see if eventually it starts working. Also maybe just throw in a normal part with a clickdetector in it and make sure that is actually working. Good luck!

i’ll try to put a part in my face.

not even that is working. it worked before what the hell. it’s a fixed camera but wtf

works PERFECTLY without fixed cam, i’ll try with fixed… it works… in the test game hahahahaahhahaahahahhaahahahhahahahahaha

1 Like