Hello, and thanks for helping! I have a problem when i want to make invisible a GameObject (disabling its mesh renderer). It works well in the Server, because when i click the gui button the server player turns invisible on server, but in all the other clients does not…
I have got 2 player objects: One for the Server, and other for all the clients (so there can be only 1 server player and multiple client players). Both makes use of the same movement script (the script attached here is IN the movement script).
I suppose that if in the script is defined directly (without the boolean) the Server Player Mesh Renderer the script should work well but i dont know how to do this.
And here is the invisible script:
var myMeshRenderer:MeshRenderer;
//drag the objects MeshRenderer over this variable
var RenderMesh:boolean = true;
//this will give you a toggle box on the object
//containing the mesh
var invisibilitat = true;
function OnGUI (){
if (GUI.Button(Rect(20,20,20,20), "Invisible!"))
invisible();
}
function invisible()
{
if(RenderMesh)
{
myMeshRenderer.enabled = true;
}
if(!RenderMesh)
{
myMeshRenderer.enabled = false;
}
yield WaitForSeconds(5);
myMeshRenderer.enabled = true;
}
Sorry for my english, ask me anything ill try to answer 
The code you have there does not tell the clients to change anything about the renderer- you need to send every signal you want synchronised by an RPC. Keep in mind that there is absolutely no reason why you need to have two different objects or scripts for ‘server’ and ‘client’- Unity’s networking already takes care of that for you. You can use ‘networkView.isMine’ to determine ownership, as well as ‘Network.peerType’ to find out if you are a server or a client. Make sure you have a NetworkView on the object, and that it has been correctly instantiated and synchronised (same networkViewID on both server and clients), then try something like this:
function OnGUI (){
if (GUI.Button(Rect(20,20,20,20), "Invisible!"))
networkView.RPC("RemoteInvisible", RPCMode.All);
}
}
@RPC
function RemoteInvisible()
{
invisible();
}
This will call the function ‘invisble’ on all players, server and client, so long as they all have the same object/script (and it is synchronised using a NetworkView).
Hello again, Thank you for that awsome explication! I will try this code in Monday, so i will reply if it worked :).
Can i ask you another question about networking and cameras? I would like to make 1 camera for player, in first person (actually it would be perfect to be as player the “First Person Controller” unity prefab), but when i use this prefab all the clients/servers mooves all the cameras… I have tryed to use if NetworkView.isMine but i dont know where it has to go, and i have also tryed many thing posted here but anything worked ore i didnt know how to do it. Could you help me with that?
you can make single network camera for everyplayer by using this C# code:
public Camera mycamera;
void Update(){
if(!islocalplayer){
mycamera.enable = true;
}else{
mycamera.enable = false:
}
}