Disabled NetworkIdentity GO's when new scene starts

Ok, allow me to say that I know that by default, any GameObject with a NetworkIdentity is switched off automatically if it is a scene object. My problem is getting them to actually re-enable themselves when the scene switches. I have two players waiting in a lobby where they use a button to ready up, and then they transition to the game scene where the scene objects only turn on for the host player. Any ideas? Here’s my button code:

public void PlayersReady()
    {
        if(player1.isLocalPlayer)
        {
            player1.readyToBegin = !player1.readyToBegin;
            if(player1.readyToBegin)
            {
                player1.SendReadyToBeginMessage();
                readyButton.image.overrideSprite = readySprite;
                readyFrame1.enabled = true;
            }
            else
            {
                player1.SendNotReadyToBeginMessage();
                readyButton.image.overrideSprite = notReadySprite;
                readyFrame1.enabled = false;
            }
        }
        if(player2.isLocalPlayer)
        {
            player2.readyToBegin = !player2.readyToBegin;
            if(player2.readyToBegin)
            {
                player2.SendReadyToBeginMessage();
                readyButton.image.overrideSprite = readySprite;
                readyFrame2.enabled = true;
            }
            else
            {
                player2.SendNotReadyToBeginMessage();
                readyButton.image.overrideSprite = notReadySprite;
                readyFrame2.enabled = false;
            }
        }

As far as my Play Scene goes, NONE of my GameObjects with NetworkIdentites will load beside the player2 GameObject. My hypothesis is just that the the client cannot load as fast as the host player and just leaves the objects off. Not 100% sure though

The objects are disabled on your client because they haven’t received the spawn message from the server.

It’s pretty hard to say exactly what is going on, given the code you posted, but here are some things to try:

  • Make sure you are using the NetworkManager.StartHost and StartClient for your host and client
  • Use a separate offline scene for your lobby, and an online scene for when they are playing, and set them in your NetworkManager. If you are doing any other than this to change scenes, it gets complicated pretty quickly.
  • Add a NetworkManagerHUD component to the same object as your NetworkManager, uncheck the GUI option. Run the host in the editor, inspect this component to see what has spawned on which clients
  • Set the NetworkManager.logLevel to Debug in the Inspector and look at the logs
  • examine the examples sticky thread in this forum

Wait, so there needs to be two separate lobbies then? I have the same lobby scene as the one players are both offline and online in, with the GUI changing depending on the state of the network

if you have the same scene for online and offline, the manager handles things differently behind the scenes, and it will be up to your code to do some things differently. try using two scenes, one offline and one online, and I believe your life will be simpler

Hmm, I seem to have some trouble changing scenes. The lobby scene MUST be first, or I can’t set it in the inspector. Conversely, I can’t start on the actual lobby scene. Thoughts?

I’m afraid I haven’t used the Unity lobby system.