When you say you are assigning the ball a variable, do you mean that you are doing something like:
local Ball = workspace.Ball
Then you can try this:
function Main()
while wait(0.1) do
local IsTouching = CheckParts(DesiredBrick)
If IsTouching then
print(“Touching”)
else
print(“Not touching”)
end
end
end
function CheckParts(DesiredBrick)
local Found = false
local TouchingParts = DesiredBrick:GetTouchingParts()
for I, v in pairs(TouchingParts) do
If v == Ball then
Found = true
break
end
end
return Found
end
I just found out why this wasn’t working. :GetTouchingParts only creates an array of intersecting parts. It should really be named :GetIntersectingParts .