function CharacterRealism.ComputeLookAngle(V,c,m)local R=FpsCamera:IsInFirstPerson()local O,L,Z=0,0,1 if not c then local m=workspace.CurrentCamera c=m.CFrame.LookVector end if c then local m=V.Player.Character local D=m and m:FindFirstChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")if D and D:IsA("\066\097\115\101\080\097\114\116")then local m=D.CFrame O=-m.RightVector:Dot(c)if not R then Z=math.clamp(m.LookVector:Dot(c)*10,-1,1)end end L=c.Y end if m then Z=m end O*=Z L*=Z return O,L end


function CharacterRealism:ComputeLookAngle(lookVector, useDir)
	local inFirstPerson = FpsCamera:IsInFirstPerson()
	local pitch, yaw, dir = 0, 0, 1
	
	if not lookVector then
		local camera = workspace.CurrentCamera
		lookVector = camera.CFrame.LookVector
	end
	
	if lookVector then
		local character = self.Player.Character
		local rootPart = character and character:FindFirstChild("HumanoidRootPart")
		
		if rootPart and rootPart:IsA("BasePart") then
			local cf = rootPart.CFrame
			pitch = -cf.RightVector:Dot(lookVector)
			
			if not inFirstPerson then
				dir = math.clamp(cf.LookVector:Dot(lookVector) * 10, -1, 1)
			end
		end
		
		yaw = lookVector.Y
	end
	
	if useDir then
		dir = useDir
	end
	
	pitch *= dir
	yaw *= dir
	
	return pitch, yaw
end
