-- Function called when a player character joins the game

local function onCharacterAdded(character)
	-- Put all of the current parts of the model into the player collision group
	setCollisionGroupRecursive(character, playerGroup)
	
	-- Put any part that gets added to the character later into the collision group
	character.DescendantAdded:Connect(function(descendant)
		if descendant:IsA("BasePart") then
			PhysicsService:SetPartCollisionGroup(descendant, playerGroup)
		end
	end)
end
