Active/Dis-active Gameobject By RPC

Hello Everyone
I’m Trying to Active/Dis-active Object and send it by RPC
but its notworking

	public GameObject Light1;
	public GameObject Light2;

If(ITurnItOn == True){

			Light1.SetActive(true);
			Light2.SetActive(true);
networkView.RPC("TheLights",RPCMode.OthersBuffered,Light1,Light2,"true");

}
else{

			Light1.SetActive(false);
			Light2.SetActive(false);

networkView.RPC("TheLights",RPCMode.OthersBuffered,Light1,Light2,"false");
				
}



	[RPC]
	public void TheLights(GameObject light1,GameObject light2,string Switch){
	if(Switch == "true"){
	light1.SetActive(true);
	light2.SetActive(true);	
	}
	else if(Switch == "false"){
	light1.SetActive(false);
	light2.SetActive(false);		
		}

	}

Have a look at this page

You cannot pass a game object as an argument (light1 and light2). Make sure that every player has its variables Light1 and Light2 (the public ones at the beginning of your script) valuated, and your method should be like :

[RPC]
public void TheLights(string Switch){
    if(Switch == "true"){
        Light1.SetActive(true);
        Light2.SetActive(true);    
    }
    else if(Switch == "false"){
        Light1.SetActive(false);
        Light2.SetActive(false);     
    }
}

Note that I called the variables Light1 and Light2 in the method, and not light1 and light2.

Good luck with your game !