Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Canvas Scaler?

Discussion in '5.5 Beta' started by TommySKD, Sep 6, 2016.

  1. TommySKD

    TommySKD

    Joined:
    Jul 23, 2014
    Posts:
    25
    Canvas Scaler behavior seems to be different from 5.3.0, im not sure if it is because I was using it wrong and somehow making it work before and now it got fixed, or if it is because it is bugged in this version.

    I stopped using it anyways, turns out I didn't need it, but im curious to know if other people encountered this problem.

    I think it had problems updating itself (camera zoom was changing but scaler kept same size all the time) when I was messing with it.
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    What is the exact difference, as this could be related to my UI issue, just couldnt explain it properly..
     
  3. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Are you two on Mac with retina screens? Note that on Mac with retina screens the Game View is now in retina resolution (because the entire editor is) so every pixel is half as big. Depending what settings you use for CanvasScaler, that might affect how things look. Just a guess.

    How a change in Unity 5.3.0 related to beta though?
     
  4. TommySKD

    TommySKD

    Joined:
    Jul 23, 2014
    Posts:
    25
    I am not on Mac, and im saying the canvas scalers worked fine in 5.3.0, but when I upgraded to beta they broke/changed somehow.
     
  5. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    Something is changed about Canvas Scaler for me also.
    It seems that it's not "triggered" on first start to render canvas according to Camera when render mode of canvas is set to "Screen space - Camera".
    If I then disable/enable canvas gameobject or for example resize Game view that it changes it's size for at least 1px canvas will be successfully rerendered in proper size.

    Edit: I forgot to mention that I have just downloaded and tried beta 5.5.0b3.

    scaler1.png scaler2.png canvas1.png
     
    MrEsquire likes this.
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yes this is the problem I seem to be having also, thank you for the detailed explanation to the Unity Team.
     
  7. andrecosta

    andrecosta

    Joined:
    Sep 28, 2015
    Posts:
    4
    I can confirm this is the case. I'm using 5.5.0b3 but I think I experienced this behaviour in b1 as well.

    I have a Canvas in Screen Space - Camera. When I "zoom" the camera by changing its orthographic size, the HUD elements do not scale. If I make any change in the Canvas Scaler component everything seems to snap back to the correct place.

    I was also able to reproduce it on an empty project with only a camera and a Screen Space - Camera Canvas with a Text element inside anchored to the top left corner, and changing the camera's orthographic size.

    To work around this issue for now I'm changing the referenceResolution property of the Canvas Scaler via script by minuscule amounts to force an update.

    989255e6bf.png
     
  8. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    If you were able to create a repro project did you create a bug report for Unity team to take a look at it.
     
  9. andrecosta

    andrecosta

    Joined:
    Sep 28, 2015
    Posts:
    4
    Yes I've just sent it.
     
  10. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    Small update: Setting canvas to "Screen Space - Overlay" has fixed issue for canvases. They are rendered "fullscreen" taking whole area of camera view. But I didn't plan to use them like that so it's not rendering parts of my game as I have planned.
    @andrecosta : Is there some link to reported bug issue? I would like to track to see if there will be any progress with this.
     
  11. andrecosta

    andrecosta

    Joined:
    Sep 28, 2015
    Posts:
    4
    The issue ID is 831304.

    Maybe I can find another workaround to do what I need without relying on zooming the UI's camera since this was my main issue. I'll keep working on it in the meantime.
     
    Last edited: Nov 14, 2016
  12. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi everybody,
    The UI team has been notified about this thread.
     
    andrecosta, MrEsquire and Pharaoh like this.
  13. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Any news on this, really need a fix in next beta or cannot make release of game.
     
  14. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I'll have to take a closer look tomorrow when i get some time. Though dont have any news on why its happening or any work around.
     
  15. cabbyU

    cabbyU

    Joined:
    Sep 21, 2016
    Posts:
    18
  16. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Any news on this beta 5 has no changes?
     
  17. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
  18. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
  19. topaz7

    topaz7

    Joined:
    Dec 15, 2012
    Posts:
    76
    This issue still exist and broke my whole game as it was based on UI. o_O
     
    MrEsquire likes this.
  20. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    We cannot release games unless this is fixed, should it not be top priority!! wtf
     
  21. thxu2

    thxu2

    Joined:
    Jan 12, 2016
    Posts:
    33
    I fix this by change canvas property in runtime.

    Start()
    {
    canvasScaler.matchWidthOrHeight = 0.5f;
    }
     
  22. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    I know way back when i said i'd take a look. Pretty sure i did but i will take another look Monday when i get back to the office. I have reminders set :).
     
    karl_jones likes this.
  23. topaz7

    topaz7

    Joined:
    Dec 15, 2012
    Posts:
    76
    Thanks!
     
  24. patrickf

    patrickf

    Unity Technologies

    Joined:
    Oct 24, 2016
    Posts:
    57
    Hi,
    A fix is in the pipeline for this bug. Unfortunately it is not in 5.5.0b9, but it should be available in 5.5 soon (in the next release if all goes well).
     
    MrEsquire likes this.
  25. topaz7

    topaz7

    Joined:
    Dec 15, 2012
    Posts:
    76
    Awesome! Thanks a lot.
     
  26. patrickf

    patrickf

    Unity Technologies

    Joined:
    Oct 24, 2016
    Posts:
    57
    Hi again,
    The fix will be available in 5.5.0b11
     
    JonSWEDEN likes this.
  27. Pharaoh

    Pharaoh

    Joined:
    Jan 8, 2014
    Posts:
    28
    Seems that Unity 5.5.0b11 has fixed the issue I was having with Canvas Scaler. Can someone else confirm if the issue has also been fixed for him. Tnx
     
    bbbbico likes this.
  28. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    168
    Yep - working for me too.