Collision group not being set

I have made a script that sets the player’s collision group when they join, but it does not change anything. any way to fix this? (sorry for weird looking script, I did it in a rush)

game.Players.PlayerAdded:Connect(function(plr)
	local chr = plr.CharacterAdded:Wait()
	repeat
	for i,v in pairs(chr:GetChildren()) do
			if v:IsA("BasePart") or v:IsA("Part") then
				v.CollisionGroup = "Player"
			end
			end
	until plr.Torso.CollisionGroup == "Player"	
end)

this is the script, also nothing pops up in output

You don’t need the repeat until.
Also torso is probably not a valid member of the player, but of the player’s character.

1 Like

i tried it without the repeat but still nothing happened, i also added a wait in case

How are you checking if the collisiongroup is set?
Is the collisiongroup created?

im looking in the properties of the parts and yes the collision group created

any ideas on how i can fix this?

Add print statements to check if the code runs the CollisionGroup assignment.

i fixed it another way, thanks anyways!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.