I have an enemy NPC that needs to raycast. I have it filter all descendants of the enemy.
local filter = {} --creating table for filterdescendantinstances
for i, part in pairs(script.Parent:GetDescendants()) do --looping through parts and blacklisting them
--if part.ClassName == "Part" then
table.insert(filter, 1, part)
--end
end
I did this because there may be mesh parts and other things I need to ignore not known as “parts” and I didn’t want to have to manually account for them all.
Seeing as stuff like scripts and the humanoid will be added to the filter table, will that cause an issue? Or will it not matter?