[1.0.0-exp.8] Ghost component at child ghost entity failed to sync data to client

Previously at 0.51 it’s working nicely but now at 1.0.0-exp.8, ghost component that has [GhostField] attribute tag at child ghost entity now failed to sync data. Let say u create a ghost component called TestComponent that has int value with [GhostField] attribute tag, then u write a system that runs at server only and update TestComponent value. At server world you will see TestComponent value update properly but at client world u will see TestComponent never update value data and forever stay at initial 0 value when it’s at child ghost entity. If it’s parent entity it’s still working nicely. So at 0.51 both parent and child ghost entity able to sync TestComponent value data at client world but 1.0.0-exp.8 can’t do that at child ghost entity.

It’s really very common use case that needs to always supported and working properly since we have hard limitation that we can’t put a lot of components at parent entity. Sync ghost component data back to client is must have feature.

public struct TestComponent : IComponentData
{
[GhostField]
public int value;
}

The ghost is setup like this right?

Parent:  <-- GhostAuuthoring
 - Child
      - TemoComponent

This is not a bug.

It is the intended default behaviour.
In 1.0-exp we changed how components on child entities are replicated. By default they are not serialised.
This to enphatise the fact child entities are really slow and you should think twice before serialising them,

But you can easily change that. You can either:

  1. Add a GhostComponentAtttribute to the TestComponent
[GhostComponent(SendDataForChildEntity = true)]
public struct TestComponent : IComponentData
{
[GhostField]
public int value;
}
  1. Modify that on the prefab by adding on the child GameObject a GhostAuthoringInspectionComponent and select for the TestComponent its default serialization variant.

Ya. Thanks a lot. It’s working now.

:frowning: Actually I dun really want to have ghost component at child entities and wish to put all of them at parent entity but we only have maximum 16 kb chunk.

Well, yes, but 16kb of memory for a single entity are quite a lot in my opinion.
How many component does these entity has? How large they are? Do you have somehow buffers.
In the latter, it may be the case to reduce the default InternalBufferCapacity that we try to embed in the chunk for them to either 0 or a smaller value than the default (that is 128 / sizeof(bufferElement) IIRC).

It would be nice to share (without real code) how you actually end up with such a large entity. Maybe there are things to optimise/squeeze.

@optimise please mark this as resolved
A fix for this has been already added to 1.0-pre.15