Search Unity

Unity UI Odd behaviour with multiple child canvases

Discussion in 'UGUI & TextMesh Pro' started by GroZZleR, Mar 17, 2019.

  1. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    I'm working through some optimization techniques for my UI, and following the advice from this video, I've been adding child canvases to differentiate between dynamic and static elements. However, I'm having an odd issue: If I store the prefabs with the child canvases in overlay mode, when they're added to the main overlay canvas, their RectTransform data gets completely obliterated:

    Prefab setting:

    overlay1.png

    Result after being added to the main overlay canvas (editor or during play, same result):

    overlay2.png overlay3.png


    If I set the canvas mode to world space though, even though they're being added to an overlay mode canvas, everything is fine:

    world2.png world3.png

    It seems wrong to store the prefabs in the wrong canvas mode, but obviously fixes the problem. Any explanation for why this is happening?