Help with being able to change FOV in this script

heyo, its been about 3 years since I’ve scripted anything and I forget alot, so I wouldn’t mind asking for some help with this script.
It makes the players cam go onto a part and then follows the curser (I did not script it), used for a main menu and i wanna be able to adjust the FOV how and where would that go in the script

–// Variables
local cam = workspace.CurrentCamera
local camPart = workspace.CameraPoints[“1s”]
local mouse = game:GetService(“Players”).LocalPlayer:GetMouse()

–// Set cam
repeat
wait()
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable

–// Move cam
local maxTilt = 10
game:GetService(“RunService”).RenderStepped:Connect(function()
cam.CFrame = camPart.CFrame * CFrame.Angles(
math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -maxTilt),
math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -maxTilt),
0
)
end)

local mouse=game:GetService("Players").LocalPlayer:GetMouse()

cam.FieldOfView=70

repeat task.wait()
1 Like

greatly appreciated, thank you :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.