The script I’ve used for many other games doesn’t work in the game I’m currently working on, here is the script.
local phys = game:GetService("PhysicsService")
phys:RegisterCollisionGroup("plrtrue")
phys:CollisionGroupSetCollidable("plrtrue", "plrtrue", false)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAppearanceLoaded:Connect(function(char)
for i, part in pairs(char:GetDescendants()) do
if part:IsA("BasePart") then
part.CollisionGroup = "plrtrue"
print("Added " ..part.Name.. " to collisions!")
end
end
end)
end)
Your script likely doesn’t work because you are using CharacterAppearanceLoaded, which doesn’t always wait for all parts of the character to be ready. Some parts, like accessories or tools, are added later, so they do not receive the collision group.
Try using this script
local phys = game:GetService("PhysicsService")
phys:CreateCollisionGroup("plrtrue")
phys:CollisionGroupSetCollidable("plrtrue", "plrtrue", false)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local function setCollision(part)
if part:IsA("BasePart") then
phys:SetPartCollisionGroup(part, "plrtrue")
end
end
for _, part in pairs(char:GetDescendants()) do
setCollision(part)
end
char.DescendantAdded:Connect(setCollision)
end)
end)