Replies: 1 comment
-
That's what I would do. It's just cheaper then re-replicating the whole world from scratch. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a little vehicle builder, which has 2 states: editing a vehicle, and playing with your vehicle in a world.
The world is replicated from the server, however editing is client only.
Based on singleplayer logic, when a client goes into the editing state it unloads and cleans up entities from the world state. This causes an error because bevy_replicon tries to replicate to a deleted component.
So ideally, I'd disable replication on the client when it goes into the editing state, and then re-enable it when going back to the world.
The only way I figured to currently do this would be to send an event to the server, and then having the server disable replication. This however add annoying latency, and looks like it will require the addition of a "waiting for server to stop replication state", which would be annoying to add.
Alternatively, I could change it so instead of cleaning up all the world entities it just makes them invisible, but this feels a bit like an anti-pattern to just keep replicating invisible things in the background. (Though now I think about it, stopping replication altogether also feels a bit like an antipattern, so I don't see a really clean way to do this yet.)
Beta Was this translation helpful? Give feedback.
All reactions