Layers and Rendering Control...?

EDIT 2:

Hi,

how would I render N layer, then have remote users not render that N layer?

In the scenario of lets say, user input:

  • the player in control is put into a “dead” layer.
  • users not in a dead layer cannot render him
  • users in dead layer can render him (including themselve(s))

And help is disired.

What I have tried is iterationt through the hierarchy using this technique: http://answers.unity3d.com/questions...ssignment.html

As of now, when this ‘user input’ scenario is executed:

  • I cannot render the user in control
  • I render players outside the layer
  • Players who are outside the layer do not render my player in control

EDIT: If your player has an existing hierarchy please follow this link: Fast layer assignment - Questions & Answers - Unity Discussions

I'm not sure about the int myLayer = transform.gameObject.layer = 11; line. Could you split that up? gameObject.layer = 11; Debug.Log(gameObject.name + " is in layer " + gameObject.layer);

manually change the player to layer 11 in the inspector, run the game. if the player is visible then your mask is set incorrectly. If the player is invisible then it is one of your scripts.

1 Answer

1

Layer indices are bitwise. You must use operator<<.

gameObject.layer = 1<<11;

Is this a negative answer? I think qato is somewhat bugged...