- Home /
Load Previously Instantiated Network Objects
I am working on a networked game. The issue is that I'm not sure how to get the client to load objects that have already been instantiated before it connected.
My code looked like this:
// Server
void OnServerInitialized() {
Network.Instantiate(player);
}
// Client
void OnConnectedToServer() {
Network.Instantiate(player);
}
The result was that the server could see both instances of players, but the client would not see the instance the server created before it had connected. I'm not sure how to get the client to pull that instance.
As an example, say a new player connects to a multiplayer game while the match is happening, the new client needs to load an object for each of the other network players.
Answer by Swift_On_Fire · May 22, 2012 at 08:44 PM
I figured it out. I had to LoadLevelAdditive instead of LoadLevel. What was happening was that the RPCs were getting sent to the client, but that was happening before loading the level. Then the LoadLevel call would erase what had already been loaded.
Your answer
Follow this Question
Related Questions
Synchronizing Gameobjects over a Network Server < - > Client Sync 0 Answers
How do i access a network instantiated object? 1 Answer
UNET : SyncVar value not updating, hooks firing 1 Answer
How to load all character previously in game when new player joins 0 Answers
Failure generating network code 1 Answer