Hello! I’m having a weird thing happen with click detectors in my game and I’m not sure what’s causing it. I have a fairly large map (the baseplate dimensions are [1504.255, 16, 1398.885], ) and I have a local script that is supposed to count how many buttons around the map are clicked.
When I have a button on the far right side of the map, the script works perfectly fine, but when it is on the far left of the map, nothing happens?
here’s a block of the code I’ve been tinkering with, located in the StarterPlayerScripts
for i, btn in pairs(BTNS) do -------------------------------------if button pressed vv
local clickDetector = btn:WaitForChild("ClickDetector")
clickDetector.MouseClick:Connect(function(chr)
clickDetector:Destroy()
table.insert(buttonsfound, btn)
updateIndicator()
print(#buttonsfound)
if #buttonsfound == #mapButtonsFLDER:GetChildren() then
spawnClickDetector(chr)--spawn for frog clickdetector
showFrog()
print("FOUND")
Collider.ClickDetector.MouseClick:Connect(function() --frogClickDetector clicked
print("collected")
OSFevent:FireServer(chr)
end)
end
end)
end
Any feedback is appreciated, thank you!