Search Unity

Changing the FOV axis from vertical to horizental

Discussion in 'Scripting' started by Faiz_Belk, Apr 27, 2021.

  1. Faiz_Belk

    Faiz_Belk

    Joined:
    Mar 1, 2021
    Posts:
    41
    Hi all,

    i just want to know what is the command to change the fov axis from vertical to horizental.

    Thank u
     
  2. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,065
    You can't, Unity FOV is always vertical. You need to convert your horizontal FOV to vertical and/or update the vertical FOV whenever the aspect ratio changes to ensure a constant horizontal FOV.

    Since Unity 2019.1 there's Camera.HorizontalToVerticalFieldOfView to convert the FOV.
     
    Bunny83 and Joe-Censored like this.
  3. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    186

    upload_2022-9-28_16-31-14.png
    How about this option?
    Field of View Axis
    (2021 LTS)
     
    Liderangel likes this.
  4. Anisoropos

    Anisoropos

    Joined:
    Jul 30, 2012
    Posts:
    102
    Not exposed in the API (it's named m_FOVAxisMode) - 0 is Vertical
    upload_2023-6-16_12-50-42.png
     

    Attached Files:

  5. Adrian

    Adrian

    Joined:
    Apr 5, 2008
    Posts:
    1,065
    Bunny83 and Anisoropos like this.