Hi, I'm making a script that you can walk through other players. I can still walk through other players. What am I doing wrong?
Script:
local PhysicsService = game:GetService("PhysicsService")
local CollisionGroupName = "Players"
PhysicsService:CreateCollisionGroup(CollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(CollisionGroupName, CollisionGroupName, false)
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
for _,Child in pairs(Character:GetChildren()) do
if Child:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Child, CollisionGroupName)
end
end
end)
end)
Script Location: ServerScriptService, a server script.

2 comments
your question is not clear but if you want players to not collide then thats what your code does for me, if its not doing that for you then it might be because the children of the character hasnt had time to load in
Not clear, I'm using collision groups for all players so they can walk through each other and not push each other. The last thing you said fixed it, thanks.