NetworkLobbyManager: How to spawn a lobbyprefab as the child of another GameObject.

I’m working on a class which inherits from the UnityEngine NetworkLobbyHandler, and I’d like to make some modifications to have the lobbyPlayer prefab spawn inside of another GameObject simply called lobby, to help me contain all of the players.

The lobby GameObject needs to either be server-only, or synced so that it stays up to date on both client and server.

The syncing is something I can manage, but whenever I try to spawn the lobbyPlayer inside of the lobby game object, this only works on the server. Furthermore, the method I am using to change the parent of the instantiated lobby player (OnLobbyServerCreateLobbyPlayer) is only called on the server, and I can’t figure out where in code the lobbyPlayer is spawning on the client.

I was hoping somebody with more experience of the NetworkLobbyManager would be able to point me in the right direction here, I feel like I’m getting nowhere alone.

Here’s what I have on the server, which is working as expected.

And here’s the client, lobbyPlayers aren’t in the _Lobby object.

For anyone following this question, I spent a long time doing some research, and it doesn’t seem that spawning the prefabs as a child is the best option.
Unfortunately, this would require rewriting lots of components of the HLAPI, like the network identity, which contains the Spawn method used by clients.
Some of the methods aren’t just overwritable too, but if you’re facing the same issue and you would like to attempt this approach, the source code for the HLAPI is here

In my scenario, I have a PlayerData script attached to the prefab. I simply spawn the prefab normal and changed the parent when the PlayerData script start method is called.

I was concerned that this method would create a small gap in which the transform had not yet been updated, but I’ve not experienced any issues when gathering gameobjects in the lobby transform so apparently not.