How to make my terrain scanner interactable with a transparent mesh?

Hi, I am trying to create a terrain scanner where it can scan for invisible objects, showing the outline of the object without the mesh being visible. But as long as my surface type is transparent, the scan ignores my mesh completely. Is there a way that I could maybe create an opaque material that’s transparent? I created the terrain scanner effect following this tutorial on youtube:

Any advice or suggestion on how I could achieve my desired effect will be highly appreciated, thank you!

this is most likely due to the transparent shader not writing to the depth buffer , try enable ZWrite for your shader and see if that fixes it.
Alternatively , you can add another material to your mesh renderer that writes “Depth Only” and doesn’t actually render any color , you can look for a shader that does that if you don’t have it already

If your scanner effect utilizes depth texture to project the effect, then it’s obvious - transparent objects do not write to depth texture and zBuffer. You can’t just enable depth write for transparent objects, then your effect wouldn’t apply on the stuff behind the transparent object - not to mention the incorrect rendering of the transparent objects themselves.

What you can do though, is to apply the projection on opaque objects as you are doing now, but add a Projector that renders this effect for all transparent objects in the area.

Projector is simply an object that renders all renderers within its volume with its own material and a custom projection matrix. You can write a shader that does the same effect, but instead of using depth buffer, you actually re-render the transparent meshes with the scan shader, and get the depth from vertices instead of depth texture.