How to mask gameObject by gameObject


How to mask gameObject by gameObject
is there any shader or plugin to do that



This is what you are looking for:

(EDIT: outdated link fixed, thanks @ArturoSR and @jokim)

The Depth Mask Shader it’s no longer in the site mentioned before, here it is the actual unity wiki site.

There is a component called Mask in UGUI could help you, if you are using UGUI.

You can disable the renderer or deactivate the gameobject. This is going to make the object disappear instantly. If you want it to fade, you need a transparent shader. There is the built-in ones and you can download them here if you want to look them up.