I am making a game that i want the ground to delete unanchored parts but i dont want humaniods to die. I made a script that deletes the parts but i deletes all parts humans, anchored parts, and unanchored parts.
✓ ANSWER ACCEPTED
how do i make a part delete ONLY unanchored parts?
1 answer
✓ Accepted answer
This isn't tested and may be a bad way to do it, but i think this may help you
for i,v in pairs(Part:GetTouchingParts()) do
if v.Anchored == false and not v.Parent:IsA("CharacterMesh") and not v:IsA("CharacterAppearance") then
v:Destroy()
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Change part to your parts, and put this somewhere where it will keep rerunning or whatever you do to make it delete them