renews
3/12/2015 - 9:52 PM

Camera FOV Unity - Control by Mouse

Camera FOV Unity - Control by Mouse

 var minFov: float = 15f;
 var maxFov: float = 90f;
 var sensitivity: float = 10f;
 
 function Update () {
   var fov: float = Camera.main.fieldOfView;
   fov += Input.GetAxis("Mouse ScrollWheel") * sensitivity;
   fov = Mathf.Clamp(fov, minFov, maxFov);
   Camera.main.fieldOfView = fov;
 }