Synchronize Object Names

Hey there,

I got a problem when network.instantiating objects. So the situation is that the server is spawning objects every x seconds on all clients. To be able to controll these objects (give them targets or states) I need to know their names that I can later filter via RPC. So for example I would send out an RPC to all clients with the name of the object and the new coordinates this objects needs to go. On Client side the Object then would filter if the transfered name is his own and if true, he would take the coordinates. But for doing so I need to give the object the same name, server and client sided. So anyone has an idea how to transfer the object name from server to client and be sure that the right object receives the transfered name, when multiple objects are network.instantiated at the “same” time?

Hope someone can help me.

I don’t see why you would need to do this, make the server authoritative and then do all the actions server side.
The client will get updated through it’s NetworkView.
You can also send an RPC to a NetworkPlayer, so if you would store anything it would be the NetworkPlayer object.
Read up on the NetworkView Component and how they work, you don’t seem to understand how they work.

Thanks for your reply. I am using RPCs to send Data so achieve non stuttering objects. If I choose state synchronization by the networkview, it is stuttering. So I am just sending information as soon as somthing changes (new movement target or such things).

So if for example I create the following objects on the server:

Object A
Object B
Object C

and Object B got hit on the Server and then sends an RPC to the client. Are all 3 Objects receiving the RPC or only the Object B on the Client, if all objects are created on Server using network.instantiate?
If all Objects receive the RPC I need a way to tell them that the RPC is only for Object B, right?

Read the documentation is all I can say, your questions all get answered if you just took the effort to look in the docs:
http://docs.unity3d.com/Documentation/ScriptReference/RPCMode.html

I already read this yesterday, but it did not answer my question -_-

Basically you instantiate the objects on the server and then call an RPC ( to any of the options available ) on the networkview of the instance.
An example would be:

GameObject player = (GameObject)Network.Instantiate(prefab, ....);
player.networkView.RPC("FunctionToCall", RPCMode.AllBuffered, myvar);