Problem – Sprite Mask Does Nothing or Hides Everything in URP

Symptom:
After moving a 2D project to Universal Render Pipeline (URP), your Sprite Mask either:

  • No longer masks sprites at all, or
  • Hides entire sprites or layers unexpectedly.

You may also see the mask working in the Scene view but not in Game view, or only in certain cameras.

This usually happens because URP and the 2D Renderer require explicit setup for masking, including correct materials, renderer settings, layers, and sorting.


Step 1 – Confirm You Are Using the 2D Renderer in URP

Sprite Masks are most predictable when your URP asset uses the 2D Renderer.

  1. Open Edit → Project Settings → Graphics.
  2. Locate your URP asset (UniversalRenderPipelineAsset).
  3. Select that asset in the Project window.
  4. In the Inspector, check the Renderer List:
    • If you see a Forward Renderer, you are not on the dedicated 2D Renderer.
    • For primarily 2D projects, create or assign a 2D Renderer asset.

If you change to the 2D Renderer:

  • Re‑enter Play Mode and test your mask again before making further changes.

Step 2 – Check Sprite Mask Interaction Settings on the Renderer

URP’s 2D Renderer has per‑camera and per‑renderer controls that affect mask behavior.

  1. Select your camera.
  2. Ensure it uses the correct Renderer (with the 2D Renderer assigned).
  3. In the 2D Renderer asset, review:
    • Transparency Sort Mode / Axis for 2D projects.
    • Any experimental features that might override sorting or blending.

If you recently cloned or replaced a URP asset, your camera might still reference the old renderer.
Make sure the camera and renderer asset match your current 2D setup.


Step 3 – Verify the Sprite Mask and Sprite Components

On the Sprite Mask object:

  1. Confirm the Sprite Mask component has a Sprite assigned.
  2. Set Alpha Cutoff to a sensible value (for solid masks, start around 0.5).
  3. Check the Is Custom Range option if you want to restrict which sorting layers are affected.

On the sprites being masked:

  1. Ensure they use the Sprite Renderer component (or compatible 2D component).
  2. Set Mask Interaction to one of:
    • Visible Inside Mask
    • Visible Outside Mask
      instead of None.
  3. Verify the sprite’s Material is using a URP‑compatible 2D shader (Sprite-Lit-Default, Sprite-Unlit-Default, or an equivalent 2D shader that supports masking).

If your sprites use custom materials (for example, Shader Graph), make sure the shader includes the mask interaction keywords; otherwise, Sprite Masks will be ignored.


Step 4 – Fix Sorting Layers, Order in Layer, and Z Position

Even with correct components, masking can fail if sorting is wrong.

  1. Open Edit → Project Settings → Tags and Layers → Sorting Layers.
  2. Make sure:
    • The Sprite Mask is on a sorting layer that sits above or at the same level as the sprites you want to affect (depending on how you use Is Custom Range).
    • Your target sprites are on the intended sorting layers.
  3. On each Sprite Renderer:
    • Check Sorting Layer and Order in Layer values.
    • Avoid large gaps or inconsistent orders that push sprites behind the background.
  4. Inspect Z Position:
    • In a pure 2D setup, keep Z close to 0 for both mask and sprites unless you have a specific parallax setup.
    • If the mask is far in front/behind, some cameras or render settings may cull or skip it.

Tip: Temporarily set both the mask and one test sprite to the same sorting layer and very simple order values (for example, Mask: 0, Sprite: 1) to confirm they interact.


Step 5 – Test With a Known‑Good Material and Scene

To rule out project‑wide configuration issues:

  1. Create a new empty scene.
  2. Add:
    • A camera that uses your URP 2D Renderer.
    • A Sprite Mask with a simple shape (a circle or square).
    • A test sprite using Sprite-Unlit-Default or Sprite-Lit-Default.
  3. Set the sprite’s Mask Interaction to Visible Inside Mask.
  4. Play the scene and move the mask across the sprite.

If this fresh scene works, differences between it and your main scene (layers, custom materials, post‑processing, camera setup) are likely causing the original problem. Port the working settings back into your main scene.


Step 6 – Watch for Common URP‑Specific Pitfalls

Some URP features can interfere with Sprite Masks:

  • Camera Stacking

    • If you stack cameras, confirm that the mask and sprites are rendered by the same camera or correctly stacked cameras.
    • Inconsistent stacking order can make masks appear to do nothing.
  • Renderer Features

    • Heavy use of full‑screen effects or custom renderer features can change how transparency and depth are handled.
    • Temporarily disable custom features and retest the mask.
  • 2D Lights

    • Extreme light settings can wash out masked/unmasked areas so the effect looks broken.
    • Try disabling 2D lights or lowering intensity to see if the mask effect becomes visible.

Verification – How to Confirm the Fix Worked

Use this quick checklist:

  • [ ] Sprite Mask has a sprite and logical Alpha Cutoff.
  • [ ] Sprites have Mask Interaction set correctly.
  • [ ] Sprites use URP‑compatible 2D sprite materials.
  • [ ] Sorting layers and order in layer are consistent and simple.
  • [ ] Camera references the correct URP 2D Renderer.
  • [ ] A fresh test scene with mask + sprite works as expected.

If all of the above are true and you still see issues, try:

  • Creating a brand‑new URP 2D project and reproducing your setup step by step, or
  • Comparing your project’s URP asset with Unity’s 2D URP sample templates.

Prevention Tips

  • When upgrading to URP or changing render pipelines:
    • Test a small sample scene with Sprite Masks before migrating full projects.
    • Keep a checklist for camera, renderer, sorting layers, and materials.
  • Avoid mixing many different custom shaders for basic sprites unless you have a strong reason; stick to the built‑in URP 2D sprite shaders for core characters and UI.
  • Document your 2D rendering conventions (sorting layers, orders, Z ranges) in a short project style guide for your team.

Related Help Articles

  • Unity URP Shadows Not Rendering – Lighting Fix
  • Unity Animator Not Working – Animation System Fix
  • Unity Texture Import Stuck or Fails – Asset Pipeline Fix
  • Unity 2026 Editor Slow or Laggy – How to Fix (Performance)

Found this useful? Bookmark this page for future URP migrations and share it with teammates who work on 2D rendering and UI.