[1.0-pre.15] Entity reference in unmanaged SharedComponent

Hello,
I need to store an entity reference in a shared component :

public struct MotionSpace : ISharedComponentData
{
    public Entity value;
}

// ... in baker :
AddSharedComponent(new MotionSpace { value = baker.GetEntity(root) });
// ...

At runtime, the shared component still holds the entity from the conversion world and is not patched like standard components.

Looks like a bug to me but maybe it’s a limitation of SharedComponents?

Entity remapping is only supported by unmanaged IComponentData and IBufferElement at the moment.

This is at least the 3rd post on this in the past month so it would not surprise me if they added support to unmanaged ISCD in the future, but for now it is not a supported feature.

1 Like