for index, child in pairs(wendigoParts) do print(child.Name) if child.CanCollide then print(child.Name, " Can Collide") PhysicsService:SetPartCollisionGroup(child, wendigoGroup) end end
The script is always stopping on the
if child.CanCollide then
It is stopping when it runs into something that does not have the CanCollide inside of it. I thought the if CanCollide ment if it has the CanCollide feature the next line runs?
Try this code:
for index, child in pairs(wendigoParts) do print(child.Name) if child:IsA("BasePart") and child.CanCollide then print(child.Name, " Can Collide") PhysicsService:SetPartCollisionGroup(child, wendigoGroup) end end
Changes that I made:
(Thanks to @NathanTheDeveloper): Tested to see if child
was a BasePart
and if it had true
for CanCollide