I have an entity scene that creates ghosts at runtime while containing a few other non networked entities.
The scene is loaded using SceneSystem.LoadSceneAsync. The clients loads the scene first. As soon as they finish, the scene is loaded on the server.
This works as intended without any errors or warnings.
Using SceneSystem.UnloadScene to unload the scene on the client, results in a client disconnect as it is no longer able to find the ghost prefabs.
To fix this, I unload the scene on the server and then send and RPC to all clients to do the same. This does not result in a disconnect but I'm getting warnings on the client.
It seems like the client has not received the info that the ghosts no longer exist, which triggers the warning that I 'delete ghosts on the client'.
The only approach I've found so far is to use an entity query with a shared component filter on the client to check if the scene no longer contains ghosts. Is this how a scene unload like this should be handled or is there a better approach?