Sprite Masking

This section describes how to mask sprites.

What is Masking?

  • In Unity, the mask is a component that automatically crops the target sprite like a window.

  • Technically, you will need two game objects: the target object and the masking object.

  • If you want to use the masking for your Avatar, you should use the Rigged Mask 2D Component instead of the Sprite Mask.

The Sprite Mask wouldnโ€™t work on rigged sprites in Unity.

How to apply the masking effect?

1. It is pretty straightforward. Make sure to select the GameObject that you want to use as a Mask

2. In the inspector, click the add component button and select the Rigged Mask 2D.

3. Tab the Fit to source sprite button.

4. Thatโ€™s it. Now you will see the source sprite is cropped.

It is not going to be working if the masking sprite has multiple bones

If you want to animate masking sprites, you might need to add the Sprite Resolver

5. There are several options that you could choose from in the Mask Interaction.

  • None

  • Visible inside Mask

  • Visible outside Mask

Last updated