NetworkLobbyManager Manually ServerChangeScene ignores to create server object
Hi everyone, I'm adapting the NetworkLobbyManager just to learn how to use it in the future, or to create my own. The thing is, I did override OnLobbyServerPlayersReady() in order to add a countdown when players hit ready. Now it looks like this (note that I commented the base.OnLobbyServerPlayersReady() on purpose)
public override void OnLobbyServerPlayersReady()
{
StartGameTempo = (float)Network.time + TimetoStartGame;
PlayerConfigPanel.TimeToStart = StartGameTempo;
TimeTicking = true;
PlayerConfigPanel.TimeTicking = TimeTicking;
//base.OnLobbyServerPlayersReady();
}
And I load the next Scene calling ServerChangeScene() (I didn't override this one)
Now, everything works fine, but when it loads the game scene (after lobby and countdown) NetworkLobbyManager creates the gameObjects for players, but immediately after it deletes them.
I guess I miss something overriding OnLobbyServerPlayersReady() and I would like to know what it is (Some kind of register the object spawned, or give it an attribute so the LobbyManager stops refusing him, I dont know!). Could somebody please help me?
Also, would be great if could see the NetworkLobbyManager source code to understand whats he doing under the hood, it would REALLY speed up my learning. Is it possible?
If you need to know anything else, please let me know!
Thanks, Regards
I am having what I think is a similar problem? When I use ServerChangeScene it will bring the host player GameObject over just fine but it completely drops any currently connected clients. They appear to just lose their connection. (NOTE: I am not using any of the ready up systems, just wanting the host to bring along all clients without them providing any input)
Answer by sglindme · Jun 28, 2016 at 09:25 PM
Did you ever figure this out? This function seems so messed up.
At the end I didnt override OnLobbyServerPlayersReady().I did a completely manual ready system with timers as a workaround. At the end this system called OnLobbyServerPlayersReady().
This is a médium solution.
Best solution: dont use the Network Lobby $$anonymous$$ánager at all. In fact, dont use UNET at all! $$anonymous$$ove to PUN (Photon Unity Network). If you use UNET, in the future, in the game scene you will need to do lots of workarounds to get things done because of bugs and/or missbehaviours of UNET.
Sadly UNET still undercooked. I guess sometime in the future it will be good enought to invest time on it.
Your answer
Follow this Question
Related Questions
Network Soccer Ball Position jitter, sending transform position late? 0 Answers
UNET AssetID 0000 zero 0 Answers
PLS recommend plugins for networking/sever which ONLY work for authentication + storing player info. 0 Answers
Couldn't delete cache in UnityWebRequest 0 Answers
how to spawn a player prefab on a server 0 Answers