cBournhonesque / lightyear

A networking library to make multiplayer games for the Bevy game engine
https://cbournhonesque.github.io/lightyear/book
Apache License 2.0
498 stars 51 forks source link

avian_3d_character example floor does not render in host-server mode #686

Closed sQu1rr closed 6 days ago

sQu1rr commented 2 weeks ago

As title says, if example is run in host-server mode, the floor is not rendered. I narrowed it down to not having the Replicated component (instead it has Replicating) when run in host-server mode.

I am currently trying the lightyear for my project, and this is the exact issue I stumbled upon myself. I need static level objects to appear on both remote and local clients. What is the best way to achieve that?

kajusTheDwarf commented 2 weeks ago

I've got exactly the same issue, didn't had time too look into it tho.

sQu1rr commented 2 weeks ago

After playing around with the replication configuration, I concluded that static object cosmetics do not need filters when applied. In the example, cosmetics were applied to the floor using a Replicated component, which is exclusive to the client. Adjusting the filter to unconditional resolves the issue.

This approach makes sense because the client will only receive the Replicated entity, while the server/host-server retains the original one. There are no duplicate entities to begin with, as we do not predict nor interpolate the floor.

PR submitted.