- Home /
Cut out sprite alpha using other textures
I have a 2D whack-a-mole style game where I am trying to layer the background and cut holes in it for the enemies to pop out of. I can't work out how to use one image and cut holes in it with different alpha images. I don't want to draw a separate image for every layer because that seems like a waste of file space when I only really need the alpha applied.
Basically a mask, but easy to assign an alpha to each sprite game object.
Answer by dfpdev · Jul 18, 2016 at 04:56 AM
I managed to get it working using shader code from this page http://forum.unity3d.com/threads/sprite-renderer-mask-on-specific-sorting-layer.356824/ But the shader does not use soft edges in my 2D alpha clipping mask. I'm not sure if this can be solved.
Your answer
![](https://koobas.hobune.stream/wayback/20220612084720im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Where are the Sprite Masks? 0 Answers
Transparency on overlapping 2D objects 0 Answers
How to mask sprites/animations using alpha channel 0 Answers
Sprite masking 3 Answers
How to get rid of dark line on the edge of transparent pixels? 2 Answers