Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Changing Character Group Collision not working can u help?

I used the Plugin that automaticly makes the group collision, the only thing I need to change is the number of the part, I need help as this is not working.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for i,v in pairs(char) do
			if v:IsA("BasePart") then
				v.CollisionGroupId = 2
			end
		end
	end)
end)

2 answers

The default collision group id is 0. That means that you probably have to change your collision group id to 1 instead of 2.

1 comment

0

The correct one I need is 2 not 1, It just keeps it set at 0.

I found the issue, I forgot to get the children of the char and It was just a object value. Here is what I did to fix it.

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for i,v in pairs(char:GetChildren()) do
			if v:IsA("BasePart") then
				v.CollisionGroupId = 2
			end
		end
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.