Hello,

I am trying to find out how to find out how to change a variable in an object I just instantiated over the network using an RPC call. However, the variable damage and gameObject name only change locally and not over the network. This object and the object I’m trying to reach have a networkView. Any help is appreciated.

[RPC]
	public void DealMapWideDamage(float amount)
	{
		mapWideAOEClone = Network.Instantiate(Resources.Load("MapWideAOE"), new Vector3(0,0,0),Quaternion.identity,0) as GameObject;
		//Need to find out a way to give MapWideAOE the variable damage
		mapWideAOEClone.name = "Damage";
		Damage_Script damage_Script = mapWideAOEClone.GetComponent<Damage_Script>(); //Get damage script and deal some damage
		damage_Script.damage = amount; //etc.
    }

void Update() //Using update to show how I'm declaring the rpc call
{
     networkView.RPC("DealMapWideDamage",RPCMode.All,damage);
}

There aren’t any errors in the code as far as I can tell. Note that when you use networkView.RPC, you’re calling the RPC on that networkView on all clients. So if you want to tell the enemy you hit to take damage, you would call that enemy’s networkView instead of your own.

Are there any errors popping up or are debug.logs simply not showing up?