0
\$\begingroup\$

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

windows view

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?

\$\endgroup\$
1
\$\begingroup\$

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); 
\$\endgroup\$
  • \$\begingroup\$ +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... \$\endgroup\$ – Jim W Feb 3 '15 at 5:17
0
\$\begingroup\$

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

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.