I have a script using the Part:GetTouchingParts() method to get the parts that my model is touching. I then have another section of the script that iterates through each part of the returned table. This is supposed to check if the part in the table is a descendant of the model or if the model is an ancestor of the part (It could work both ways) and then remove it from the table if it is.
The problem is that there is no operator or method to do something like IsAncestorOf() or IsDescendantOf().
Here is what I have so far:
local Touching = Model:GetTouchingParts()
for i, Part: BasePart in pairs(Touching) do
-- Check for the ancestor or descendant... (Need help here)
table.remove(Touching, i)
end
end
Any help would be greatly appreciated! Thank you for your time!
I could but I can only provide a string into the method, not an instance. I need a way to check the relationship between two instances that are already defined.