Hi,
can you tell me how to get camera zoom?
6 Likes
Very Vague, but you can use tween service to tween the camera to the desired field of view.
local DesiredFOV = 35
local TweenIn = game:GetService('TweenService'):Create(workspace.CurrentCamera,TweenInfo.new(1),{FieldOfView = DesiredFOV })
local TweenOut = game:GetService('TweenService'):Create(workspace.CurrentCamera,TweenInfo.new(1),{FieldOfView = 70})
while true do
wait(1)
TweenIn:Play()
wait(1)
TweenOut:Play()
end
1 Like
Please search before you post because a simple search should be able to give you an answer to your question. On the developers hub it states this:
The
Camera’s
zoom is defined as the distance in studs between theCamera.CFrame
and it’sCamera.Focus
.
Here is a simple script:
local Camera = workspace.CurrentCamera
print((Camera.CFrame.Position - Camera.Focus.Position).Magnitude)
22 Likes
I looked at it, but I overlooked it, sry
2 Likes