Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Sevenarth · Sep 28, 2012 at 07:38 PM · resolutionssupported

Screen.resolutions doesn't work very well

Hi everyone! I'm making an FPS with some friends, and today i encountered a big problem with Screen.resolutions variable. I'm using this function to get all supported resolutions:

 bool supportedRes(int w, int h)
 {
     bool mb = false;
     int k = 0;
     foreach(Resolution r in Screen.resolutions)
     {
         Debug.Log ("Index " + (k+1) + ": " + r.width + "x" + r.height);
         if(r.width == w && r.height == h) mb = true;
         k++;
     }
     return mb;    
 }

I think that's ok, but when i start the game the Debug.Log function reports me these supported resolutions:

Index 1: 640x480 Index 2: 480x60 Index 3: 60x800 Index 4: 1024x768 Index 5: 720x60 Index 6: 60x1280 Index 7: 1280x960 Index 8: 1024x60 Index 9: 60x1366 Index 10: 1440x900 Index 11: 900x60 Index 12: 0x0 Index 13: 0x0 Index 14: 0x0

It's very strange, i think the Unity.Resolution variables are changing their information with other variables, for example in Index 5 we got 720x60(x1280) but he must be 1280x720(x60). And that fake indexes? 12, 13, 14? And why with index 11 i get 900x600x0 when i must get 1600x900x60

I hope you can help me..greetings.

Sorry for bad english, but i'm a young italian guy :D

Comment
Add comment · Show 2
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 DaveA · Sep 28, 2012 at 07:48 PM 0
Share

Did you try the code here? http://docs.unity3d.com/Documentation/ScriptReference/Screen-resolutions.html

avatar image Sevenarth · Sep 28, 2012 at 07:59 PM 0
Share

yep, no changes.

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

10 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

Related Questions

Adding y position? 4 Answers

How do I fix textures? 0 Answers

What is the problem in my script? 2 Answers

Camera Problem 0 Answers

Why is my camera shaky in editor but not in compiled project? 4 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