I have this code (stolen from wiki, i'm learning i'm learning)
wait(0.001)
script.Disabled = false
local offset = Vector3.new(40,40,40)
local fieldOfView = 25
local player = game.Workspace.Elf
local camera = game.Workspace.CurrentCamera
local runService = game:GetService('RunService')
camera.FieldOfView = fieldOfView
local function onRenderStep()
local playerPosition = player.Torso.Position
local cameraPosition = playerPosition + offset
camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition)
end
runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onRenderStep)
game.StarterGui:SetCoreGuiEnabled("All", false)
The problem is that the distance between the camera and player changes per screen resolution. How do I make it so the field of view changes for bigger/smaller screens?
