Help...About Transparent Shader.

Well, it’s kind a weird problem…that I have 2 players right now. And I am setting [idlePlayer] to fade to half transparent when the [currentPlayer] touches [idlePlayer].
But here comes a problem, though the [idlePlayer] faded out, but I can not see the should be seen parts of [currentPlayer]…

For example, I have a 1-meter tall P1 and a 2-meter tall P-2. and when they stand together, P-1 fades out, and right now I should have seen the whole P-2 through the half-transparent P-1, but I only see the upper part of P-2, the rest of the parts which hiding behind P-1 is invisible…like Harry Potter wearing his invisibility cloak…

I am using the transparent Diffuse shader of Unity. I wander this is a shader problem…and asking for help.

Thanks very much! know, reading this my poor English… guess I gotta improve it.

![alt text][2] ![alt text][1]

this is the problem I mentioned, you see in the left pic,we can see the human through thehalf-Alphaed robot, but in the right-pic, we can not see the whole human…


Maybe your problem is being caused by the way transparent objects are drawn: they use the render queue value to define who will be rendered first (and hidden by the other).

To solve this problem, you can set the queue number of the active player to a higher number - lower queue objects are drawn first, thus the higher queued ones will cover it.

If you have a main script controlling which player is currently active, you can add a code like this to it:

var baseQueue = 3001; // draw over the default transparent layer (3000)
var player1: Transform;
var player2: Transform;
var activePlayer: Transform;

function Update(){
  if (activePlayer == player1){ // draw player1 over player2
    player1.renderer.material.renderQueue = baseQueue+1;
    player2.renderer.material.renderQueue = baseQueue;
  } else { // draw player2 over player1
    player1.renderer.material.renderQueue = baseQueue;
    player2.renderer.material.renderQueue = baseQueue+1;