nicholas-maltbie / PropHunt

PropHunt game attempt using Unity and the Data Oriented Technology Stack
MIT License
11 stars 0 forks source link

Reload Sub Scene on Connect/Disconnect #88

Open nicholas-maltbie opened 4 years ago

nicholas-maltbie commented 4 years ago

Seems like the proper way to handle connect and disconnect with sub scenes it to reload the scene. Here is a forum post with more information https://forum.unity.com/threads/netcode-and-subscenes-question.972954/#post-6336114

When you place instances of ghosts in a subscene they will be instantiated on both the client and server as pre-spawned ghosts, and then hooked up to synchronize based on current server state. This assumes that you unload and reload the subscene on the client when you reconnect - if you don't you can end up with multiple instances of the ghosts on the client. You should be getting an error or warning if doing it wrong, sounds like you did not and that would be a bug.

nicholas-maltbie commented 3 years ago

Seems like this feature is not yet supported in netcode. They say they will fully support it sometime in December 2020 (at least the other way of loading objects will be removed) so I can only hope this will resolve the issue. Otherwise we will need to write our own subscene loader and unloader from prefab/generated objects.

(Can convert a scene to binary information and distribute that to clients but will be a difficult process).