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

Is there a way to check part collision with cancollide false?

Asked by 6 years ago
Edited 6 years ago

The part is being moved automaticly in another script aswell as a script is activated in the part to check for the colliding parts. But this only works for cancollide being true. I have used the following ways without success:


local filter = true local destroyableitems = {""} script.Parent.Changed:connect( function() local theparts = script.Parent:GetTouchingParts() for i=1,#theparts do if filter then local destroyable = false for i2=1,#destroyableitems do if theparts[i].Name == destroyableitems[i2] then destroyable = true break end end if destroyable then theparts[i]:Destroy() end else theparts[i]:Destroy() end end end) and script.Parent.Touched:connect(function(part) part:Destroy() end)
0
You can try FindPartsInRegion3, but that'll only work if your part isn't rotated. RubenKan 3615 — 6y
0
Thank you I will try that handsomebob10 0 — 6y
0
Your suggestion works perfectly. handsomebob10 0 — 6y

Answer this question