Search Issue Tracker

Fixed in Unity 2018.2



Found in


Issue ID




RectMask2D stops masking, when it's child has a child with Mask and Image components inside the RectMask2d area




Priority: 2Necessary for shipping a final release


Severity: 3Secondary functionality broken

It reproduces when UI Object with a "Rect Mask 2D" has a child object (which is not the first child in hierarchy) which also has a Child with Image(script) and Mask(script) components. Also, there must be another UI element on the Canvas, so that object with the "Rect Mask 2D" is not the most bottom child of Canvas.

To reproduce:
1. Open "Test" scene, from ""
2. Open Game (or Scene) window and inspect, that RectMask2d is working correctly.
3. In Hierarchy find "Canvas -> RectMask -> Parent_of_Mask" and enable "Parent_of_Mask" object.

Expected result: Enabling this object does not change the way RectMask2d works.
Actual result: RectMask2d is no longer working.

Reproducible: 2017.2.0b6, 2017.2.0f3, 2017.3.0b4, 2018.1.0a1
Not Reproducible: 2017.2.0b5

Make sure Object with RectMask2D is the bottom child in Canvas.

Comments (7)

  1. 0ce14ff4d167fbeaaa8336e50fabdd4b?d=mm


    Jun 13, 2018 15:36

    Also reproducible in Unity 2018.2.0b7.

  2. 0ce14ff4d167fbeaaa8336e50fabdd4b?d=mm


    Jun 13, 2018 15:36

    Reproduced in Unity 2018.2.0b6.

    RectMask2D + TextMeshPro input field children which use RectMask2D, will bleed out the text outside the mask.

  3. 4ee0c9e55184e63d7ae638e12220820a?d=mm


    Jun 06, 2018 18:25

    I can still reproduce this issue in Unity 2018.2.0b6 when doing a WebGL build. Shader.EnableKeyword("UNITY_UI_CLIP_RECT"); is a work-around we are currently using, but I don't think this is fixed yet (or there is another similar issue).

    Unity 2018.2.0b6 without work-around (incorrect/no masking):
    Unity 2018.2.0b6 WITH work-around (properly masking):

    Version information from js console: Initialize engine version: 2018.2.0b6 (ac34ff94dd0f)

  4. D8b9e6f77eff9d3f09383570860f9738?d=mm


    Mar 16, 2018 12:35

    BFE_GIO saved us all, this appears to be working:


  5. B55c31a6949126e513acafe0f8392845?d=mm


    Jan 22, 2018 23:40

    Dealing with a similar bug in 2017.2.0p2 (in our case the RectMask2D just randomly clips or doesn't clip various things). A workaround that *seems* to be working for us is to call this at startup somewhere:


  6. 1e578ff7c407631b8b3a23af0ce4cd6c?d=mm


    Jan 11, 2018 14:53

    Reproduced in 2017.2.0p3

  7. 4f900efb70ed95fb6c2112b0ce022ba4?d=mm


    Nov 03, 2017 13:03

    Reproduced in 2017.3.0b7

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.