- Home /
How to make a portion of an object invisible when it is behind a transparent object?
Hello All,
I am creating a game that (in general terms) has a front image, middle image, and background image on the screen all at once. The background image has a random pattern inside of it and the front image has a solid opaque thick border with a transparent inner portion (so you can see the local area of the background image through it). The front image can also be a random shape. The middle image moves across the screen from the left to the right. When the middle image is behind the front image, i would like the middle image to be invisible so that the background image is still showing through it. This problem is probably best explained through a picture rather than words, so please see the attached diagram outlining this.
I have been stuck on this for a while now, going back and forth between creating a second camera (and adjusting the depth/layer settings of each image) or using a custom shader to handle this. However, I haven't had any luck with either strategy yet.
Does anyone have any recommendations on how to solve this issue?
Answer by jonjubb · May 21, 2018 at 02:07 PM
After some further searching, I was able to find a video detailing how the Sprite Masking Interaction property works (https://www.youtube.com/watch?v=1QktsHJwXCQ).
I was able to solve my problem using what i learned in the video!
Your answer
Follow this Question
Related Questions
Unhide unseen objects. 1 Answer
TransparencyLM - Colored Shadows 0 Answers
Transparent object makes other objects act strange 0 Answers
OnPreRender updates shader parameters for each eye in 5.3 but not in 5.4? 0 Answers
How to make make an object look like an Opaque but still have Alpha fading effect? 1 Answer