Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing Character Group Collision not working can u help?

Asked by
uhTeddy 101
5 years ago

I used the Plugin that automaticly makes the group collision, the only thing I need to change is the number of the part, I need help as this is not working.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        for i,v in pairs(char) do
            if v:IsA("BasePart") then
                v.CollisionGroupId = 2
            end
        end
    end)
end)

2 answers

Log in to vote
0
Answered by
luachef 61
5 years ago

The default collision group id is 0. That means that you probably have to change your collision group id to 1 instead of 2.

0
The correct one I need is 2 not 1, It just keeps it set at 0. uhTeddy 101 — 5y
Ad
Log in to vote
0
Answered by
uhTeddy 101
5 years ago

I found the issue, I forgot to get the children of the char and It was just a object value. Here is what I did to fix it.

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        for i,v in pairs(char:GetChildren()) do
            if v:IsA("BasePart") then
                v.CollisionGroupId = 2
            end
        end
    end)
end)

Answer this question