• 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
0
Question by CodingNoob · Dec 09, 2014 at 06:50 PM · camerauiaspect

Set camera aspect ratio and position

Hey there,

I was trying for a while now, but I can't find out how to set the camera aspect without scaling it with the screensize. I need one specific camera view on an object which shall always be displayed at a certain position in relation to the UI (eg. the header or something) and it shall always stay the same aspect ratio (4:3). Right now I managed to move the view in relation to the screen, but as soon as I change the game resolution it expands the cameras view realtive to the screen and the position of the view is also set in relation to the Screen and not to the UI...

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
1
Best Answer

Answer by PhoenixBlackReal · Dec 09, 2014 at 07:34 PM

This might be a good read: http://gamedesigntheory.blogspot.com/2010/09/controlling-aspect-ratio-in-unity.html

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 CodingNoob · Dec 10, 2014 at 09:40 AM 0
Share

thank you! that is in fact a good read!

But how could I have it always staying on a certain position of the screen, like the UI? and in a certain size?

avatar image thef1chesser · Dec 10, 2014 at 10:06 AM 0
Share

hardcode it in there. use actual numbers.

avatar image CodingNoob · Dec 10, 2014 at 10:15 AM 0
Share

ok, thank you, I'll try! :)

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.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Editor preview for retina resolution (gameobjects attached to camera or UI) 0 Answers

How can I accurately convert a Game Object's position to a sub Canvas/Rect screen position? 0 Answers

How to use two cameras in VR to display 3D object on top of UI panel? 0 Answers

2 Camera-Setup overrides Post-Processing 0 Answers

Is there a way to make a Texture2D screenshot that ignores the canvas? 3 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