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.