• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by SanSolo · Mar 14, 2015 at 11:56 AM · unity4.3

Please help to understand Orthographic camera size

I bought a complete mobile project from Unity asset store. I opened the project and checked the Camera Size (w$$anonymous$$ch was main reason for buying a project). The camera size is set to 5.8. So, as per my understanding, t$$anonymous$$s size is for a height of 580x2=1160px. However, changing the resolution in game view doesn't change the height.Only width. I deployed it on a 320x480 android phone and it looks ok with only the sides cropped. But why is there no cropping on top and bottom? target height is 1160 and my device height is 480.

Please help me understand t$$anonymous$$s. Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
6
Best Answer

Answer by NoseKills · Mar 14, 2015 at 12:26 PM

Orthograp$$anonymous$$c size means how many units in world space the viewport half height is. So when you set Orthograp$$anonymous$$c size to 5.8, it simply means that for example a cube placed at coordinates (0f, 5.8f) has it's pivot point aligned with the top of the screen (bottom half of it should be visible because the pivot is in the middle by default)

The camera will always show that same amount of world units on the screen height-wise regardless of resolution. So if you look at the game on a 200x100 pixel screen, Unity will try to render exactly the same part of the game world on the screen with a 400x200 screen. The picture will just be more detailed because the device has a better resolution.

Depending on the device's screen aspect ratio, the visible world area WIDTH can change and can be calculated based on the orthograp$$anonymous$$c size and device resolution

   float screenHeightInUnits = Camera.main.orthograp$$anonymous$$cSize * 2;
   float screenWidthInUnits = screenHeightInUnits * Screen.width/ Screen.height; // basically height * screen aspect ratio

  
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SanSolo · Mar 14, 2015 at 12:36 PM 1
Share

So it means, if i design a tile based scene and set camera height to cover 9 tiles vertically, any device will show 9 tiles, with difference in details? That clears it up. Thanks

avatar image NoseKills · Mar 14, 2015 at 12:58 PM 0
Share

Yup ! That's right.

avatar image nKolchakoV · Feb 12, 2018 at 06:54 PM 1
Share

And why its half ? Is it because we start from the center (0,0) ?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't get Mono 4.0 to go full screen on Mac OS - Mavericks? 3 Answers

Parsing Error? 1 Answer

Toggle Button for Sound On/Off 1 Answer

Animation from a Blender model not looping 1 Answer

rigidbody2D.MovePosition() Can't Found 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges