This is probably a basic question, but I’ve been learning more about ECS Netcode and, for some reason, in a small project the Sprite Renderer keeps appearing twice. I’m guessing these two sprites are from the client and server instances respectively. I’ve tried building the project to see if it was an editor quirk and unfortunately there are still two sprites with one lagging behind the other. I saw this similar post and this other one, and couldn’t really follow the discussion. I’m assuming that I’m missing something simple. Any thoughts would be appreciated!
This is a known issue. Rendering should only happen on the client, not the server. Internally we disable some rendering components, but not the SpriteRenderer unfortunately.
When we spawn the entity on the client and the server we duplicate all components. As well as the sprite renderer, which is why you see two in-game.
To solve this
- Either you disable the sprite renderer through scripting on the server.
- Or you can use Content Selection from the dedicated server package: Control which GameObjects and components exist on the client or the server | Dedicated Server | 1.4.0-pre.1
1 Like