Search Unity

URP Rect Mask 2D does not work

Discussion in 'UGUI & TextMesh Pro' started by jnyegt, Jul 6, 2020.

  1. jnyegt

    jnyegt

    Joined:
    Feb 20, 2020
    Posts:
    2
    Help!

    I am trying to just make simple 3 sprite help page UI .
    It has a Previous Page, Current Page and Next Page Images in a horizontal column.

    I want only the Current Sprite to be visible inside the mask, so i put all the images in a line, and put them as children to a GameObject with Rect Mask 2D.
    [ A ] [ B ] [ C ]

    The mask is the same size as B, so in theory A and C should be clipped and masked out.

    This setup works perfectly fine in the old 2D project, but it is doing nothing in URP.

    Any tips on how to get Mask's working in URP, or is it just fundamentally broken?

    Edit:
    The Rect Mask 2D works, if your child images have no material.
    But we require our images to have materials, so what is causing this?

    Edit2:
    I have created a new material which uses a UI unlit/alpha shader. This seems to have fixed the masking issue.
     
    Last edited: Jul 6, 2020
  2. AleNavarro

    AleNavarro

    Joined:
    Dec 30, 2016
    Posts:
    7
    This solved it for me, you saved me!

    Thanks!