- Home /
(2D intersection+picture)How to show up the invisible object when intersect with another object.
edited the picture description. Change "A is behind B " to "A is in front of B"
I have already known how to use basic overlap function such as ground check.
Thanks for such an interesting question. I don't the exact answer but I think it may be possible with the help of the shaders.
I have found the function called "mask". https://www.youtube.com/watch?v=a2gVyeZh5v0 I will try apply use it.
I tried looking around for you. Too bad my shader program$$anonymous$$g skills are terrible. This might be a good place to start though? If you can figure out how to force alpha ins$$anonymous$$d of invert color then you'd have it. https://forum.unity3d.com/threads/invert-colors-shader.205244/
I have found the function called "mask". https://www.youtube.com/watch?v=a2gVyeZh5v0 I will try apply use it.
Answer by tanoshimi · Nov 15, 2016 at 08:02 AM
What you're looking for is a Stencil mask. I wrote an example here: https://alastaira.wordpress.com/2014/12/27/using-the-stencil-buffer-in-unity-free/
Your answer
Follow this Question
Related Questions
Unity Colliders are Overlapping/Intersecting 2 Answers
Overlap detection 1 Answer
How do I check if/where in a sprite another sprite is? 0 Answers
Colliders in a wall jut out 0 Answers
Collision & 2D 2 Answers