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:

1while wait(.1) do
2    local parts = script.Parent:GetTouchingParts()
3    for i, part in pairs(parts) do
4        if part.Name == "BuildingBrick" and part.Anchored then
5            part.Anchored = false
6            part:Destroy()
7        end
8    end
9end

Answer this question