How To Set A Custom List Of Observers

I’m currently exploring the world of additive scene loading and am at the part where I need to control the set of observers each object has. When OnCheckObserver is first called during the spawning of a networked object I want it to return false. Therefore connectionToClient isn’t added to the read only list “observers”. Once the scenes have been additively loaded on the client I want it to notify the server and have the connectionToClient added to the list observers. https://docs.unity3d.com/Manual/UNetVisibility.html I have been reading this page of documentation on object visibility.

I can’t just call OnCheckObserver. I need to call the base function, I’m just not sure what or where it is? There is no function I can call called CheckObservers. It’s called the first time when a new player connections.

NetworkIdentity.observers is a read only list, so I cannot change it.

Ok, so I’ve made a little progress. All networked objects do not get the new observer added when a new player joins. The server sends a message to the player telling it what scenes to load and what sceneID’s to set in order to perfectly match the server. All this code worked before I started playing around with observers. The new part is, once a client loads the relevant scenes a message is sent to the server, the server sends that connectionToClient and adds it to a list on networkIdentity script called “playersWithVisibility”, then RebuildObservers(true) is called.

    public override bool OnRebuildObservers(HashSet<NetworkConnection> observers, bool initial) {
        foreach (NetworkConnection currentConnection in playersWithVisibility) {
            if (observers.Contains(currentConnection) == false) {
                observers.Add(currentConnection);
            }
        }
        return initial;
    }

I believe this HAS added the new observers to the read only list. And I think answers my original question. However, now I am getting:

Spawn scene object not found for 1
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

Spawn scene object not found for 2
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

Spawn scene object not found for 3
UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

...

For each object with a network identity on the client. Before I messed with observers I would get this message once, at load, then the client would be set to not ready, all the scenes would be loaded, and when it was set back to ready it just worked.

Now the clients are not getting set to not ready, instead they’re being removed from the list of observers each object with a network identity gets at spawn. The same lining up of scene id’s happens on both client and server, but now when the observer gets re-added they don’t seem to be connected, not one.

All the objects on the client that have a network identity remain with active.self = false. What’s the step I’m missing here?

Thanks.

EDIT: I just tested this same process but in a scene with a single scene and it works perfectly. Something about it being an additive scene breaks the connection when the observer tries to connect later.

Final post:
I found the solution, it was that I had to set the client to be unready before I added any connections to the list of observers then ready the client again.