using System.Collections; using System.Collections.Generic; using UnityEngine; [RequireComponent(typeof(Camera))] public class ResponsiveCameraZoom : MonoBehaviour { public float defaultFov = 4; //FOV at 16:9 Camera cam; void Awake() { cam = GetComponent(); } void Update() { float aspectRatio = (float)Screen.height / (float)Screen.width; cam.orthographicSize = defaultFov * aspectRatio; } }