I'm getting this strange error and I can't figure out why? here's the code

local ps = game:GetService("PhysicsService")
local npcg = "NpcGroup"
ps:CreateCollisionGroup(npcg)

workspace.DescendantAdded:Connect(function(p)
    if p.Name == "NPC" then
        for _,v in next, p:GetDescendants() do
            if v:IsA("Part") or v:IsA("MeshPart") then
                ps:SetPartCollisionGroup(v,npcg)
            end
        end
    end
end)

2 comments

0

check the output

0

The output literally says "Could not create collision group"