I have a script that adjusts your FOV when you scroll in/out, but when you zoom in really far, the camera movement begins to get sensitive and hard to control. I’d like to make the camera smoother and more controllable at maximum zoom distance.
(youtube link if that video doesn’t work)
This is my script:
local ts = game:GetService("TweenService")
local plrs = game:GetService("Players")
local uis = game:GetService("UserInputService")
local plr = plrs.LocalPlayer
local cam = workspace.CurrentCamera
local nextfov = cam.FieldOfView
uis.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseWheel then
if input.Position.Z > 0 then
if cam.FieldOfView > 10 then
nextfov -= 10
ts:Create(cam, TweenInfo.new(0.4,1,2), {FieldOfView = nextfov}):Play()
end
elseif input.Position.Z < 0 then
if cam.FieldOfView < 70 then
nextfov += 10
ts:Create(cam, TweenInfo.new(0.4,1,2), {FieldOfView = nextfov}):Play()
end
end
end
end)
Additionally, the method I am using for zooming in/out isn’t efficient, since it sometimes locks in an FOV and I have to spam scroll to get it to unlock. That could use some help too, but not the priority.