So to simplify the scenario let’s just say I have two scenes: the menu where connection happens and the level to walk around in. The server user (SU) will setup a game and load the Level scene, and once loading is done, call Network.Instantiate to make their avatar. Next the client (CU) comes along, connects to that game, and does the same thing.
At this point, the server has an object with the remote flag representing the connected client avatar(along with their own not remote avatar) but the client only sees himself. A few seconds later, the client gets this error (3 is the id for the SU avatar):
- View ID AllocatedID: 3 not found
during lookup. Strange behaviour may
- Received state update for view id’
AllocatedID: 3’ but the NetworkView
Why isn’t the CU being told to load objects that were called via Network.Instantiate prior to him connecting? Did I miss a step somewhere?
Upon further testing I discovered that the object is being created on the client, but it’s being instantiated in the menu scene (on connection), not the Level scene (on proper scene load.) Furthermore, if after both parties are connected I instantiate an avatar in Level 2 (another scene) he appears for everyone else even if they’re on Level 1. This is not desired behavior.
How do I make it so an avatar only loads for every client when they’re in the same scene?