function CharacterRealism.MountLookAngle(c,z)local I=z.Parent local u=I and c.Rotators[I]if not u then u={Motors={},Pitch={Goal=0,Current=0},Yaw={Goal=0,Current=0}}local z=Players:GetPlayerFromCharacter(I)if z==c.Player then u.SnapFirstPerson=true end c.Rotators[I]=u local function F(z)if z:IsA("\077\111\116\111\114\054\068")then c:AddMotor(u,z)end end for z,c in pairs(I:GetDescendants())do F(c)end u.Listener=I.DescendantAdded:Connect(F)end return u end
-- Mounts the provided humanoid into the look-angle
-- update system, binding all of its current and
-- future Motor6D joints into the rotator.

function CharacterRealism:MountLookAngle(humanoid)
	local character = humanoid.Parent
	local rotator = character and self.Rotators[character]

	if not rotator then
		-- Create a rotator for this character.
		rotator = {
			Motors = {},

			Pitch = {
				Goal = 0,
				Current = 0,
			},

			Yaw = {
				Goal = 0,
				Current = 0,
			},
		}

		-- If this is our character, the rotation
		-- values should not be interpolated while
		-- the client is in first person.

		local player = Players:GetPlayerFromCharacter(character)

		if player == self.Player then
			rotator.SnapFirstPerson = true
		end

		-- Register this rotator for the character.
		self.Rotators[character] = rotator

		-- Record all existing Motor6D joints
		-- and begin recording newly added ones.

		local function onDescendantAdded(desc)
			if desc:IsA("Motor6D") then
				self:AddMotor(rotator, desc)
			end
		end

		for _, desc in pairs(character:GetDescendants()) do
			onDescendantAdded(desc)
		end

		rotator.Listener = character.DescendantAdded:Connect(onDescendantAdded)
	end

	return rotator
end
