Hi all,
I’m experiencing an issue with the GetTouchingParts() function. My code obtains all the parts that are touching “copy”, and runs through all of them through a while loop, and if any of the touching parts are called “Floor”, then the copy is destroyed. However, when I run the code, it does print sometimes that V is “floor”, but when it does, “destroyed” is not printed. I think the fault may lie in the if statement, but I’m not sure how to fix it, so any help would be appreciated.
local touchingParts = copy.Structure.Floor:GetTouchingParts()
for i,v in pairs(touchingParts) do
if v == "Floor" then
copy:Destroy()
print("destroyed")
end
print(v)
end