AttemptToConnect() function is called when the
ConnectButton child GameObject of the
SplashScreen is clicked. If you look at the Unity components on that GameObject, you can see an
OnClick() handler which directs to the
The SplashScreen is something I’m tidying up currently and will hopefully have some improvements coming up soon. Do let me know any errors! The not disappearing sounds weird, do you actually see all your entities being spawned in scene but the SplashScreen just doesn’t disappear? There should be a clientside script on the
Player which disabled in when the
Player GameObject is enabled.
Failed to get component reference on Player(Clone)
sounds like you’ve copied some components across from HelloWorld but there are some components that are depended on but you haven’t copied those too? If this is within the
HelloWorld tutorial I’ll clone the repo and try and recreate the error - let me know?
Incoming command request with ID 1 to entity ID 8 and component ID 1500 was not handled by the worker within the given timeout.
Sounds like a race condition where a heartbeat is sent before the
Player is spawned and this is definitely an interesting race condition - do you get it consistently?
Lastly the spawner entity is currently necessary for the
HelloWorld design pattern yes. I’m currently tidying up the whole Player connection cycle so that it’s consistent across tutorials and intend to make a longer post detailing how it all works. As a brief overview, everything starts in the
Bootstrap script which has a
Start() method which runs when you press play in Unity. In the past the
SpatialOS.Connect(...) method was run in
Start() however now it’s run by the Connect button in the SplashScreen as described above which allows you to retry your connection in the client if you try and connect before SpatialOS is ready. If the
SpatialOS.Connect(...) call succeeds, this means the worker has successfully connected to SpatialOS. The
SpatialOS.OnConnected += ClientPlayerSpawner.SpawnPlayer callback in the
Bootstrap file is then triggered. This calls the static
ClientPlayerSpawner class which 1) finds the SimulationManager entity and 2) sends a command to it requesting it to spawn an entity. The SimulationManager entity then runs
CreateEntity(...) to spawn the player.
Hope this helps and keep the questions coming!