Search Unity

Problem with Mask and Canvas (Sort Order)

Discussion in 'UGUI & TextMesh Pro' started by Severok, Apr 23, 2015.

  1. Severok

    Severok

    Joined:
    Dec 2, 2013
    Posts:
    2
    I have problems with a mask.
    I have GameObject. His name "testt"

    it is necessary for me that this element was higher than all. Therefore I added Canvas and exposed Sort Order = 150. This GameObject is in "Panel" with Mask


    But GameObject it isn't visible! When I disable Mask, all is visible. Is it normal? The screen is lower




    I hope an essence of a problem it is clear. My English is poor. I hope for any help
     
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    The MASK component is there to obscure drawing behind the mask. So if your object is HIDDEN when the mask is enabled and it is VISIBLE when the mask is disabled. Then that is correct behaviour.

    However, given your placement of the Mask component on the parent panel, it is odd why only one graphic is hidden and not the entire panel.
     
  3. Severok

    Severok

    Joined:
    Dec 2, 2013
    Posts:
    2
    Thanks for the answer!

    This behavior strange seems to me. When I add CANVAS and "override sorting", my Game Object disappears
     
  4. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,689
    If you override sorting, then you need to manage it, so if it's behind other 3D elements in the camera's view, it won't be drawn.
    TBH, I wouldn't use that setting unless you REALLY had to :D