- Home /
Question by
knarola · Oct 01, 2015 at 12:04 PM ·
unity 2dlayersmaskingvisibility
How do i make an object visible in particular layer?
Please refer the below image for understanding. I have three elements - background(layer 0), foreground(layer 1) and the object. I am working on 2D game. I have used sprite renderer to set background and foreground images. I am instantiating the object during runtime. How do i make Part-A of the object invisible? I want to make object visible only on foreground....If the object is completely on background, it should be completely invisible. if the object is completely on foreground, it should be completely visible. Part-A and Part-B are just for reference. It is one single object.
screen-shot-2015-10-01-at-21121-pm.png
(39.1 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612035643im_/https://answers.unity.com/themes/thub/images/avi.jpg)