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

How To Get CanCollide = False touching parts?

Asked by 6 years ago

I want to be able to get a table of all the parts that are touching a specific part, but the part is CanCollide false and the part(s) that are touching it are also CanCollide false. How would I get those parts?

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
local part = script.Parent
part.Touched:connect(function()
    local touching = part:GetTouchingParts()
    for _, Part in next, touching do
        print(Part.Name..' is touching '..part.Name..'!')
    end
end

(ONLY works when something touched the part)

Ad

Answer this question