How to accomplish the "Stamp effect" done in Papers please? (Hiding certain parts of sprite)

So I am working in a project similar to Papers Please, but instead of checking passports, player will check packages to be shipped in a shipping office.

So when I want to accept or deny a package, I need to put a stamp on it, like in Papers Please. What I do, is when I stamp, I create a GameObject with a SpriteRenderer in the position where the stamping occurred (rendered in front of everything else).

My problem comes when I want to place the stamp on the edge of the package, because part of the stamp will be “floating in the air”. What I want to achieve is to dinamically hide that part that goes over the edge of the package, and only render the part of the sprite that is over the package.

How can I attack this problem? Thank you very much in advance.

Sorry for my English, not my mother tongue.

I found the solution !! It seemed so difficult at first, but then I found the Sprite Mask, which has been added to Unity not long ago, and it does exactly what I want.

For more reference, see this video, it’s extremely clear what to do:

Hey @Bimboleiro, im doing a simple project where i need the stamp thingy, could you please tell me how to do it or send me an tutorial becuase im a begginer dev and dont really know how to make codes like that… Thanks