In my project a player character can stand behind the wall. I want to draw it in front of all objects. An outline or solid color is good for me.
I've found a similar topic(How to make an outline of an object behind a wall?) and implemented a simple shader that displays sphere in different colors when it is behind another object.
I tried this approach on complex model such as player character, and got an issue. A solid color "pops-up" from back of model.
I'm using character from Third Person Shooter Demo, and here is shader I'm using:
I tested the shader myself and I found that everything worked except it did not support any sort of alpha channel transparency so I fiddled with it and came up with this.
Hey, the Main Color don’t change the color of the texture, so I have a Text Mesh with this material, but the text appear black, I want it white and that don’t work, how can I make Main Color work or download the font texture to change it color on photoshop ? thx
I dont know whatyou are going to do.
I am hacking Unity Games for a while now and i am using a different way!
#region Create Material
void CreateWallhackMaterial()
{
if (!WallhackMaterial)
{
WallhackMaterial = new Material(“Shader "Custom/Cham"{ SubShader { Pass { ZTest Less ZWrite On Color (1, 0.92, 0.016, 1) } Pass { ZTest Greater ZWrite Off Color (1,0,0,1) } }}”);
WallhackMaterial.hideFlags = HideFlags.HideAndDontSave;
WallhackMaterial.hideFlags = HideFlags.HideAndDontSave;
WallMats= new Material
{
WallhackMaterial
WallhackMaterial
WallhackMaterial
WallhackMaterial
WallhackMaterial
WallhackMaterial,
WallhackMaterial,
WallhackMaterial,
WallhackMaterial,
WallhackMaterial,
WallhackMaterial
};
}
} #endregion
i call this void every frame (OnGUI()) and loop through the enemys!
if u wanna see how that looks
I dont know if that helped but this is working for me