How do I change the Player's Collision Group from Client?

Hi I’m having trouble of finding a way of getting the player’s base parts to change collision groups on the client side. I really don’t know if it is possible or not, but I made a Local Script inside of the StarterGui property and this is my code (it doesn’t work yet because I don’t know how to set the collision groups using local scripts):

Please help me out and thanks a bunch!

local PhysicsService = game:GetService("PhysicsService")

local player = game.Players.LocalPlayer

game.Players.PlayerAdded:Connect(function()
	for _, v in pairs(player.Character:GetChildren()) do
		if v:IsA("Basepart") then
			--How do I set collision groups for the base parts here?
		end
	end
end)
v.CollisionGroup = "Your Group Name"

Although im not 100% sure it work but it might

3 Likes

Sorry for the wait.

Tienke’s solution will work, but also know that you can modify collision groups on the client, but not create nor delete them.

I also recommend doing a Google search instead of creating a new post completely, it not only saves effort but also time as well.

1 Like