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
4
Question by brandonhotdo · Dec 29, 2015 at 11:16 AM · uibugcanvasresolution

Canvas Scalar Scale with Screen Size Bug

I have a UI image that takes the top 20% of the screen. I've set the Canvas Scaler to scale with screen size and set reference resolution to 1920x1080. The screen match mode is shrink and reference pixel per unit is at default (100).

As I scale the game scene the ui scales with it. It will stretch and shrink maintaining a 20% coverage of the top. This is what I want.

However when I build and run the scene and choose different resolutions it doesn't scale with the resolution. Instead is seems to keep a constant physical size or pixel size.

According to http://docs.unity3d.com/Manual/script-CanvasScaler.html it should scale with the screen size to keep the same coverage. So is this a bug or am I missing something. If so please comment what it is. I'm using Unity 5.3.1f.

Comment
Add comment · Show 7
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 Brundle · Dec 29, 2015 at 05:18 PM 0
Share

I've noticed this problem too, (Unity 5.3.1f) I hope they'll fix it soon.

avatar image wlad_s · Jan 20, 2016 at 01:46 PM 0
Share

Same here. It worked fine this morning before I updated Unity to 5.3. I've tried different "cheats". I've made a coroutine which switches the resolution, then disables/enables canvas scaler component, or change some parameters. I did it in hope that the changes will trigger it to "refresh". But it didn't help :( Any news on this?

avatar image Turboloser · Apr 02, 2017 at 10:56 PM 0
Share

One year later: also noticed this bug using reference resolution 1024 x 768 ("Scale with Screen Size", "$$anonymous$$atch Width or Height" option selected). Works perfectly fine in the editor, but is broken in all builds. Using Unity 5.4.2f2, so the mentioned patch of 5.3.1p3 should be in effect but ... doesn't work. Also tried the mentioned workarounds by switching resolutions, enabling / disabling canvas and canvas scaler, changing the reference resolution - nothing worked.

avatar image brandonhotdo Turboloser · Apr 02, 2017 at 11:07 PM 0
Share

If you're on Unity 5.4.2f2 then you really should update. Unity 5.6 just came out 3 days ago and it has lots of bug fixes and cool new features such as better pathfinding and lighting. Try updating and see if that fixes it.

avatar image Turboloser brandonhotdo · Apr 03, 2017 at 07:13 PM 0
Share

Updated to 5.6.0f3, issue still there (so, i think this is a self-made-issue, not a Unity bug - but that doesn't fix my UI ;-) ) Switched Canvas to "Constant Pixel Size" and playing around with the Canvas' Scale Factor, but also noticing the same issue here. Not the entire UI is affected, though. Only prefabs, which are added by script during runtime and use the Unity UI Layout (vertical and horizontal layout groups), show this strange behaviour. UI elements, which were added within the editor and / or don't use the Unity UI Layout, are scaled perfectly fine when changing the Scale Factor.

Show more comments

3 Replies

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

Answer by wlad_s · Jan 20, 2016 at 02:05 PM

As karl.jones says here: http://forum.unity3d.com/threads/canvas-scaler-broken-in-unity-5-3-1f1.380809/

This is fixed in 5.3.1p3. http://unity3d.com/unity/qa/patch-releases

Comment
Add comment · 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
0

Answer by Fetelava · Nov 06, 2016 at 09:14 AM

I Fixed IT By Changing Reference Resolutions by 1 Pixel.
for example instead of 1920 x 1080 try 1921 x1081

Comment
Add comment · 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
0

Answer by anileapen05 · Dec 26, 2017 at 05:02 PM

please check this video

Unity UI Tutorial - Scale UI to the right size for every resolution using anchors

Comment
Add comment · 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

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

47 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

Related Questions

Unity Scene View has other Resolution then Game View. 0 Answers

Fit application to any device resolution 1 Answer

Buttons stopped working after I temporarily changed the font. 1 Answer

Different Normal vs Debug Mode values in Inspector. RectTransform bug may be? 0 Answers

Unity Canvas Anchor Can't See 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