Hi
This could have been handled later in the course, otherwise…
I can’t seem to properly figure out why I am missing the HostManager gameobject. In the video at 6:22 I can see ClientManager and HostManager have been created.
However at 19:25 I can see the HostManager has mysteriously vanished. I get the same behaviour in my project.
I believe this maybe because the HostManager has not been created yet before the scene is switched. If I comment out the scene change:
if (authenticated)
{
// clientSingleton.GameManager.GoToMenu();
}
And run, then I can see the ClientManager is created immediately but the HostManager takes a second to appear. That’s a mystery as the HostManager doesn’t have any code to delay it’s creation.
Removing my comment above and switching ClientManager and HostManager creation order to:
HostSingleton hostSingleton = Instantiate(hostPrefab);
hostSingleton.CreateHost();
ClientSingleton clientSingleton = Instantiate(clientPrefab);
bool authenticated = await clientSingleton.CreateClient();
if (authenticated)
{
clientSingleton.GameManager.GoToMenu();
}
This now works and I see both ClientManager and HostManager on the Menu Scene.
Generally I have always found my objects are instantiated immediately but I don’t play around with asynchonous programming.
Any ideas why this is happening?
Thanks!