Hey guys, I’m making a multiplayer game. It has a lobby on the menu, where the client connect to server to get informations, and then, when the client click “Join” it loads the level and play.
The problem is: i’m using the Network.Instantiate function to create the players on the game, and i’ve notice that Network.Instantiate uses a buffered RPC call, so when i connect on the lobby, it instantiate the players, but i need it to happen just when the player get with the level loaded.
Any one know how to temporarily hold a buffered rpc call, so when i finish load the level (i already have a function for that) it let the RPC calls be executed?
Thanks in advance.
the problem is that unity automatically instantiate the player prefabs when it connect to one server, because it use a buffered RPC call
– anon81905099I personally never use Network.Instantiate if I can avoid it- the automatic buffering is pretty annoying. I use Network.AllocateViewID() and then send RPC functions which make sure the NetworkViewIDs stay the same on instantiated objects (which basically does the same thing, but with more control over buffering). To be fair, Network.Instantiate is, however, much easier to use.
– syclamothThanks, i'm using the Network.AllocateViewID() and passing it in RPC (not buffered) for the players... and when a new player connect, the server send all viewIDs to the new player.
– anon81905099