# Camera position and angle different when running inside Unity and when running on Android

On Windows, running Unity 4.6.1p5, my simple game with only a cube, camera and light looks like this

but under Android (Gingerbread on a 5 inch Galaxy Player) the cube appears lower down, slightly different angle and smaller (relative to the screen size). Sorry couldn't get a screenshot with my screenshot app...

Any ideas why please?

The reason for this is most likely the different field of view (FOV in general or specific for Unity) in combination with the aspect ratio of the Android device.

This thread covers the same problem: http://answers.unity3d.com/questions/23291/same-visible-area-regardless-of-aspect-ratio.html#

The idea is to calculate the target FOV like this and apply it to the camera:

float normalAspect = 16/9f;

myCam.fieldOfView = myDesiredHorizontalFov * normalAspect / ((float)myCam.pixelWidth / myCam.pixelHeight);

• +1 Thanks, that's good to know. Doesn't seem to have been the problem here as it magically resolved itself after restarting Unity. Not sure what is going on, and I hope this isn't to be expected - Unity has already deleted the content of one of my scenes when I upgraded versions... Feb 3 '15 at 5:17

Somehow the 2 views were because Unity wasn't updating the Windows build, so it seems to have remained at a different camera position.