- Home /
How do you connect two existing networkviews?
I am creating a terrain system where the client spawns pieces as they become visible(have a large world). The terrain is somewhat editable by by players so I want to do some rpc calls to make it work. How do i have the terrain piece on the client connect to the server counterpart(alwase existing). I have a terrainmanager object that will be connected to server counterpart that could be used to initialize the terrain and setup the connection.(I could use the TerrainManager to do all the communicating with the server about changes but that would be overly complicated and not a good solution)
I need the terrain to spawn as quickly as possible and only on the one client so Network.Instantiate does't seem like it would work.
tldr. I need to connect a new piece of terrain spawned on the client when it become visible to an existing piece on the server.
Answer by NirielNabokov · Jan 09, 2015 at 12:38 PM
Two NetworkView components are connected if and only if they share the same NetworkViewID. The server knows the NetworkViewID of everything, so it needs to send it to the client who requests it. That means that the Server and the Client need to already have a way to communicate, so they must already have a pre-connected NetworkView for that.
Completely changed my answer. The docs were not clear so I thought we had to buffer NetworkInstantiate, but actually no.
Thanks,So I should be able to have the terrain manger to have a Networkview so that it can set up the connection for all the subsections of the terrain as needed. Will try that.