Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] How do I make this work while cancollide is disable?

Asked by
262187 45
9 years ago

I have a script which deletes a brick named "BuildingBrick" when it Cframes through another brick with a script. "Buildingbrick" is anchored. How would I make this script work even if cancollide is set to false?

Script:

while wait(.1) do 
    local parts = script.Parent:GetTouchingParts()
    for i, part in pairs(parts) do
        if part.Name == "BuildingBrick" and part.Anchored then
            part.Anchored = false
            part:Destroy()
        end
    end
end

Answer this question