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?
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.
I fixed the issue with waiting for the character to fully load. The parts of the character were not yet loaded into my script.