Search Unity

Canvas Renderer Hides Others

Discussion in 'UGUI & TextMesh Pro' started by etoreo, Oct 7, 2014.

  1. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    I have a hierarchy of custom Canvas Renders that looks like this:

    No matter what I do to my z-ordering the "Background" object is hiding the Bar 1 and Bar 2 renderers. If I make the Background color semi-transparent, I begin to see the Bars. I would like the Bar's to be "closer" to the camera and render "on top" of the background. but like I said, no amount of z-position fiddling results in that.

    Am I missing something about the new rendering system? It seems like this should work...
     
    Last edited: Oct 7, 2014
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    It uses the hierarchy order. Drag the 2) Background before the 2) Bars in the hierarchy order.
     
    PeteD likes this.
  3. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    That did the trick! Thank you! Now I need to figure out how to do this programmatically...
     
  4. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    Code (csharp):
    1.  
    2. SetAsFirstSibling - Move the transform to the start of the local transfrom list.
    3. SetAsLastSibling - Move the transform to the end of the local transfrom list.
    4. SetParent - Set the parent of the transform.
    5. SetSiblingIndex - Sets the sibling index.
    6.  
     
  5. etoreo

    etoreo

    Joined:
    Apr 11, 2012
    Posts:
    104
    That's handy to know, thanks!