- Home /
Sending info to/from different networkViews
I have a player with a NetworkView of 1. I need to send an RPC to a gameobject on the server with a networkview of 4. However, the player is only sending info to the gameobject with a NetworkView of 1, which doesn't have the script player is trying to access. How can I send the RPC through the correct NetworkView?
are you asking how do you talk to an object by NetVeiwId, how do you talk to a specific object on a specific system, or how do you talk to a specific object on all systems?
is this info co$$anonymous$$g from a client, or the server. what is your base framework architecture for you networking: P2P, simple client-server, authoritarian server-client?
the answers to these greatly change the accuracy, and value of the answers you get.
after re-reading: ??????
why are the objects on each system different: have different components, and from what I understand all of the objects on a system have the same NetworkVeiwID number. ins$$anonymous$$d of each object having a synchronized NetworkVeiwId across all systems that is unique to that object?
Answer by Jamora · Jul 29, 2013 at 06:09 PM
You need to do some networking magic here. a NetworkView ( NV ) can only communicate with one other NV on each client, the one with the same NetworkViewID, which is causing your problem.
Because of this limitation, it is impossible to make NV #1 to talk with NV #4 directly. Instead we can use NV #4 from the GameObject that has NV#1. What you need to do is call NV #4 from a script that is cconnected to NV #1 and tell it to send the RPC instead. The code looks something like:
//in GameObject that has NV#1
gameObjectThatHasNV4.networkView.SendRPC(/*parameters*/);