Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • 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
1
Question by unity_eUpT1lvqDGObtw · Nov 14, 2019 at 10:48 AM · resolutionsizeresizescreen size

Same size of a game object on every display

Hi,

I have been struggeling with this for a few days already. I am making a kinda vision test in Unity and need my GameObject (Image) to have the same size in cm on every screen, every resolution.

Anyone can give any input on how to achieve it?

Comment
Add comment · Show 4
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 BusaniX · Nov 14, 2019 at 11:25 AM 0
Share

Units like cm and inches and such aren't very useful because the graphics we're using are measured ultimately in pixels, and pixels can have different physical sizes (eg. iPhone 11 pixels are much smaller than GameBoy pixels) so to measure a centimeter in a PC screen you need that physical size of the pixels, then you can do a conversion, which means each screen will be vastly different. With that in $$anonymous$$d you should try to measure stuff in Unity units, especially because UI objects (like Image) are exactly suited for very flexible scaling for different resolutions. So yea, I would recommend you learn more about Unity UI and you'll probably get what you want :)

avatar image Bonfire-Boy BusaniX · Nov 14, 2019 at 12:48 PM 0
Share

But sometimes one does need screen objects to be a fixed size regardless of screen resolution, and a vision test is clearly one of those times.

@unity_eUpT1lvqDGObtw You need to look at using Screen.dpi to work out the physical size of a pixel. Then you can set the image size (in pixels) to be the physical size that you want. It can get a little more complicated depending on the platform you're ai$$anonymous$$g at but that should point you in the right direction.

avatar image dkucukahmetler · Sep 19, 2020 at 06:09 AM 0
Share

Hi! Could you find a solution for that? I have a similar problem now

avatar image Bonfire-Boy dkucukahmetler · Sep 19, 2020 at 11:19 AM 0
Share

See my comment above - you need to get hold of the DPI of the screen and use that to adjust sizes.

I didn't post a full answer due to not having time to do more than give a hint. I've converted your answer to a question, but if you get it working you could post an answer yourself. Answers are for answers to the original question on here, use comments for follow-up questions and nudges.

0 Replies

· Add your reply
  • Sort: 

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

119 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Resize every GameObject after screen resolution? 1 Answer

Mobile Game Different Screen Size Issue 2 Answers

Resolution for assets on Android 1 Answer

How to make my game fit into my droid? 1 Answer

Resize game according screen resolution 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