How can I detect how much zoomed in a player is?

Basically I want to tell how zoomed a player is. If they use the scroll wheel, they can scroll in and out. I want to store how zoomed in they are in a variable.

local zoom = player.Zoom -- How do I do it?
4 Likes

get the magnitude between the camera and the character
= (camera.cframe.p - character.humanoidrootpart.position).magnitude

5 Likes

I figured it out.

local function isFirstPerson()
	local camera = game.Workspace.CurrentCamera
	local character = player.Character or player.CharacterAdded:Wait()
	local head = character:WaitForChild("Head")
	return (head.CFrame.p - camera.CFrame.p).magnitude
end
8 Likes