how do I find an instance of an object over the network? I'm trying something like this, but it causes a crash: networkView.RPC("setTarget", RPCMode.Others, target.networkView.viewID); networkView.RPC("doAttack", RPCMode.All); @RPC function setTarget(viewID : NetworkViewID) { var view : NetworkView = NetworkView.Find(viewID); if (view) target = view.gameObject; }
Assuming the object has been instantiated over the network properly..you could just call an RPC on the object. This should automatically call the right function on the same gameobject on the various other clients.