How to ignore transparent objects when handling with ClickDetectors

local cons = {}
	local enables = {}
	for _, v in pairs(garage.SpawnZoneExample:GetChildren()) do
		print(garage.SpawnZoneExample:GetChildren())
		if not v.Name == "Floor" then
			print("reached")
			enables[v.Name] = true
			cons[v.Name] = v.ClickDetector.MouseClick:Connect(function(plr)
				print("clicked")
				if plr == winner then
					print("destroyed")
					v:Destroy()
					enables[v.Name] = nil
				end
			end)
		end
	end

I am being payed to fix some scripters system and he designed it horribly using references for placement instead of saving the cframe (serialization). Anyways a problem I am occurring is 1. this for loop isn’t running but the rest of the code is running after it. And 2. the detection of the click detector is iffy because an invisible object is clipping it and the way he coded his system was not to remove it. So I ask, how can I ignore transparent objects when handling with click detectors?

EDIT: I fixed the not detection by checking its original memory address instead of the for loops one however the problem still persist, it is unreliable the clickdetectors due to the transparent parts

you could set the transparent object to mouse target filter

so on the mousemove event or InputChanged you could filter it if the mouse.Target is transparent
it would be something like:

local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

UserInputService.InputChanged:Connect(function(input, gameProcessed)
if input.UserInputType ~= Enum.UserInputType.MouseMovement and input.UserInputType ~= Enum.UserInputType.Touch then return end
local Target = Mouse.Target
if Target and Target.Transparency == 1 then
Mouse.TargetFilter = Target
end
end)

Another way this might be done is using raycasting with whitelist or blacklist depending on how you setup the code and what types of objects these are