Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Aspect Ratio

Discussion in 'Windows' started by tmanallen, Oct 12, 2013.

  1. tmanallen

    tmanallen

    Joined:
    Nov 8, 2009
    Posts:
    395
    Hello,
    I haven't seen this in the forums but again I may have missed it, but aspect ratio, I ran my game, which is a 2d platformer and the character looks way off when I do a build for my local machine and the simulator, with regards to aspect ratio would that be an automatic feature in 4.3 or do we have to code the values for the camera? If we have to code the values for the Camera, could some explain how that would be done.

    Thanks
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,948
    Aspect ration is Screen.width / Screen.height, but I think it's calculated automatically.
     
  3. tmanallen

    tmanallen

    Joined:
    Nov 8, 2009
    Posts:
    395
    Ok, i thought that it was automatically but with my 2d game it messes up horribly. How could I check the aspect ratio?
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,948
    Camera.main.aspect might help :)