Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Camera Zoom and Zoom Out, Help me?

Asked by 6 years ago

This is meant to a camera that zooms in somewhat slowly and the zooms out, please tweak the code if you know how to fix it.

game.Players.LocalPlayer --Player:WaitForDataReady() Cam = workspace.CurrentCamera FOV = 70 for FOVChange = 1, 50 do FOV = FOV -1 Cam.FieldOfView = FOV wait (0.1) end wait (5) for FOVChange = 1, 50 do FOV = FOV +1 Cam.FieldOfView = FOV wait (0.1) end

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I got a noice bit of code that might help. Assuming you want it to smoothly zoom out, this might be of use;

local FOV = 70
local FOVChanger = 1
local Camera = game.Workspace.CurrentCamera
Camera.FOV = FOV

for i = 1, 10 do
FOV = (FOV - FOVChanger)
Camera.FOV = FOV
FOVChanger = (FOVChanger + 1)
i = i + 1
end

Dunno if it works, I'm too lazy to test it, but hopefully it points you in the right direction.

Ad

Answer this question