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.

  • You can add one of the game objects as a child if you want.

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

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.

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

  • None

  • Visible inside Mask

  • Visible outside Mask

Last updated