Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Mask with nested Canvas with override sorting

Discussion in 'UGUI & TextMesh Pro' started by dvillaverde-drakhar, Nov 26, 2019.

  1. dvillaverde-drakhar

    dvillaverde-drakhar

    Joined:
    Aug 29, 2018
    Posts:
    3
    Hi,

    I have a Unity Mask trying to mask all their children. The problem is that some of his children need to change their sorting order. To do that I've used a Canvas with override sorting. Every children using this kind of Canvas is not masked, but if override sorting is disabled, it is masked.

    How can I correctly mask these images while keeping the sorting order that I want?

    Thanks for reading :).
     
    Last edited: Dec 9, 2019
  2. dvillaverde-drakhar

    dvillaverde-drakhar

    Joined:
    Aug 29, 2018
    Posts:
    3
  3. kamarainen

    kamarainen

    Joined:
    Dec 17, 2016
    Posts:
    1
    I want to know that as well.
     
  4. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    26
    This is a problem for me now too.
    I think we need to raise a bug?
     
  5. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    26
    I have it working now.
    Add the child object with a Canvas that overrides sorting.
    Add the mask and image you need to that object or child making sure the objects to be masked out are children of it.
     
  6. Vadol

    Vadol

    Joined:
    May 28, 2016
    Posts:
    5
    Can you explain more? I don't know Am I stupid or your comment is too complicated.
     
  7. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    26
    In the hierarchy we have a Canvas at the top.
    We need to add a child Canvas under that to override the sorting order.
    In order for a mask to work correctly in this situation it needs to be a child of this second Canvas in the hierarchy.
     
unityunity