0

# My collision groups don't work on players?

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")

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.

1
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 enzotinman1 22 — 4d
0
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. Bankrovers 104 — 4d