• 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 msfredb7 · Sep 28, 2015 at 06:38 AM · resolutionscreenbug-perhapsunity 5.2

Screen.SetResolution causes screen to turn black (and other problems). Am I doing it right ?

In my game, I want players to be able to modify their resolution in runtime in a settings menu. For testing purposes, my code was like this (i've also tested other resolutions): if(Input.GetKeyDown(KeyCode.Alpha1)) Screen.SetResolution(800, 600, true); if(Input.GetKeyDown(KeyCode.Alpha2)) Screen.SetResolution(800, 600, false); if(Input.GetKeyDown(KeyCode.Alpha3)) Screen.SetResolution(1920, 1080, true); if(Input.GetKeyDown(KeyCode.Alpha4)) Screen.SetResolution(1920, 1080, false);

When I execute the function Screen.SetResolution(x, y, fullscreen), I get all sorts of scaling bugs.

My normal menu (4 arrows to go to different menu sections):..................................................... ....... ^....................................................................................................................................................... .... < o >................................................................................................................................................. ........v..................................................... 1-When i go from a small res (ex: 800 x 600) to a big one (ex: 1920 x 1080), the game screen goes to a 1080p size, but the game rendering gets HUGE (and out-of-screen). (we can see here only the top-left part of the game menu. The problem is not only the UI, the whole scene)alt text

2-When I go from a big res (ex: 1920x1080) to a small one (ex: 800x600), the whole screen goes black (nothing is rendered).alt text

3-I've tried to in and out of full screen, but it doesn't help (it even does other weird problems, like rendering the game at the right scale, but a third of the screen on the right) (I can't show you I can't put more than 2 attachments -.-)

IMPORTANT NOTE !!! If I enable the Re-sizable Window option and re-size the window, the screen adjusts perfectly. If the screen went black (case 2), it goes back to normal. If the rendering was to big (case 1), it goes back to normal.

Am I the only one with this problem ? I haven't found anything alike on the forum, unfortunately.

zzz.jpg (300.0 kB)
zzz.jpg (53.6 kB)
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
0

Answer by brandonkuka · Sep 29, 2015 at 06:08 PM

You are not alone. Unity closed out the bug (http://issuetracker.unity3d.com/issues/dx11-full-screen-with-low-resolutions-renders-incorrectly) but the issue is still present in 5.2.1.

More info: http://forum.unity3d.com/threads/5-2-canvas-stops-rendering-in-windows-standalone-in-d3d9.355944/

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 Graham-Dunnett ♦♦ · Sep 29, 2015 at 06:08 PM 0
Share

Submit a new bug?

avatar image brandonkuka Graham-Dunnett ♦♦ · Sep 29, 2015 at 06:22 PM 0
Share

I have not because it looks like others already have. Reading through this thread (http://forum.unity3d.com/threads/why-does-the-fullscreen-bug-have-no-priority.346839/#post-2308331) there are mixed results regarding the fix that was patched in 5.2.1p1. I have not yet tried the p1 patched version, so I will look at that before reporting a new bug.

avatar image brandonkuka · Sep 29, 2015 at 09:55 PM 0
Share

@msfredb7 - It looks like 5.2.1p1 patch (available here: http://unity3d.com/unity/qa/patch-releases) fixes the issue for us.

Cheers!

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

29 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

Related Questions

Make camera have a fixed screen size 1 Answer

AutoScale Screen with Perspective Camera 0 Answers

Can I customize the resolution window that appears at the start of my executable? 2 Answers

Unity screen coordinates on iPhones 1-4? iPad? 1 Answer

Screen width and height, how to bypass?! 1 Answer


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