Search Unity

[SOLVED] Canvas Scaler inspector warning "non-root canvases will not be scaled"

Discussion in 'UGUI & TextMesh Pro' started by Gooren, Oct 14, 2017.

  1. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Hi,

    I have many canvases nested within other canvases to achieve a better performance. Root canvas always has a scaler with "Scale with screen size" setting. But when I launch my game with a resolution that is lower than the reference resolution that is set within the Canvas Scaler component, then the GUI in nested canvases is not scaled at all and looks horrible.
    When I tried to add canvas scaler components with the same settings on the nested canvases as well, then it looks good, but shows the aforementioned warning in the inspector. I would try to ignore this weird behavior and move along, but always when I try to show the nested canvases, they show nonscaled for one frame first and scale only after that. Which is not cool :D

    Do you have any idea as to what is happening? Why does it scale the non-root canvases despite the warning? Should I put canvas scalers on the non root canvases at all? Is it a bug that it works?
    And why is it being shown unscaled for a period of 1 frame every time when shown?

    I'm using Unity 2017.1.2p1
     
    kraszewskiartur40 likes this.
  2. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    So as it turns out, it was my fault (obviously :D)

    When you disable the root canvas component (that has the Canvas Scaler component attached to it), then the nested canvas does not get scaled anymore. It makes sense, I just didn't notice for some reason.
     
    boraygen likes this.