Using Latest ECS and Netcode for entities:
If you create a Prefab That has two or more ghosts inside (non root level). If you spawn with instantiate at runtime the prefab spawn the same ghost twice incorrectly.
If you drag and drop the prefab in a scene, both ghosts work and show as expected, but during runtime they do not correctly instantiate.
Check the following screens:
Server Entities:
Container is the existing Prefab in the Scene, it has both a Sphere and White Object.
The second container, is a Entity That has a system that runs and spawns a prefab with EntityManager.Instantiate
This is the client view:
You can clearly see that White was spawn twice instead on the client.
If I move the Sphere in the server view, a wrong ghost is moved in the client.
This is the game view:
Top is the Prefab dropped in the subscene , correctly working with both a cube and sphere.
Bottom is supposed to be the same thing, but its instead two cubes on top of each other
In the same way, all the components that are specific to the Sphere Object are missing in the client and present in the server.
Adding a Ghost Component to the root level Authoring Game Object, prevents the ghosts from being spawn on the client altogether, and in this situation, the Root Level is just a requirement to group both prefabs into a single drag and drop Object. Does not need to replicated or synced in anyway.
Is this expected behaviour? Because it looks clearly a bug, and if not a bug, is this behaviour written anywhere on the documentation?