Color mask for tagged objects

im not really familiar with shaders and how do they work, but i really need this one:

Shader "ColorMask Works!/ColorMask 0" {

SubShader
{
	ColorMask 0
	Pass {}
}

}

how can i apply the action this shader does (color masking) only to objects tagged “hide”?
any help will be appricitated.

I don’t recommend using Shader.Find at runtime; just store a variable of type Shader.

so if i got you right, im getting the objects i want to use in the shader through a script, and then put them inside a variable in the shader through the script?
than what? im sorry its the first time im acctually trying to edit a shader…

You do it however you want. The shader editing isn’t related to the assignment of a shader to a material.

okay but i want the shader to work on the specific objects (i dont know how to keep the shader work as it is now but only on objects i want it to work on) i mean after i got the objects on a variable, how to apply the shader to them? and not to others…
i dont mean to put the shader in their material, i know how to do that. i have an object i want to hide, i put this shader inside a cube and it hides the objects behind the cube. now if i have anything behind the object i want to hide, it hides them too… i want the shader to be on that cube but just to do what it does only for the tagged objects “hide”. something like the bloom and flares do (on the option to bloom the tagged objects)

I don’t know how the bloom of flare shaders work, but I don’t know of a way to do what you’re talking about. My recommendation would be to put this shader in a very late queue, and the objects you want hidden in the queue after that.