-- Called when the player's character is added.
-- Sets up mirroring of the player's head for first person.


function FpsCamera:OnCharacterAdded(character)
	local mirrorBin = self.MirrorBin
	
	if mirrorBin then
		mirrorBin:ClearAllChildren()
		mirrorBin.Parent = nil
	end
	
	self.HeadMirrors = {}
	
	for _,desc in pairs(character:GetDescendants()) do
		self:AddHeadMirror(desc)
	end
	
	self:Connect("AddHeadMirror", character.DescendantAdded)
	self:Connect("RemoveHeadMirror", character.DescendantRemoving)
end
