How to use Horizontal Field of View in unity.

To put it simply. this can cause ripping of the hair. a lot.
so here my loyal subjects is the code required.

public static float HorizontalToVerticalFOV(float horizontalFOV, float aspect) {
        return Mathf.Rad2Deg*2*Mathf.Atan(Mathf.Tan((horizontalFOV*Mathf.Deg2Rad)/2f)/aspect);
    }

hopefully this helps some people. pass it the horizontal FOV you want and the camera.Aspect of your camera and it should work.
now you have 2 ways of working with FOV.
if i have one request it is that you add an FOV slider that goes to 110 at least into your game. if you really want to be a baller add an option to use either horizontal or vertical fov.
happy FOVing! =3

3 Likes

Nice. Works great.

1 Like

I’m glad! good luck. =3