I have this error coming from my authoring script:
Blittable component type contains a (potentially nested) pointer field. Serializing bare pointers will likely lead to runtime errors. Remove this field and consider serializing the data it points to another way such as by using a BlobAssetReference or a [Serializable] ISharedComponent. If for whatever reason the pointer field should in fact be serialized, add the [ChunkSerializable] attribute to your type to bypass this error.
Bit confused by this, it seems to relate to this component:
public struct Walls : IComponentData
{
public SparseGrid WallGrid;
public NativeHashMap<int, int> ConnectionFlags;
}
It seems to specifically not like: public NativeHashMap<int, int> ConnectionFlags;
But I don't understand why, because its perfectly fine with SparseGrid of which contains:
public struct SparseGrid
{
public readonly float GridSize;
public NativeHashMap<int, NativeList<Entity>> Map;
//ctor etc...
}```
My authoring code looks like this:
```csharp
var e = CreateAdditionalEntity(TransformUsageFlags.None);
NativeHashMap<int, int> Conns = new(0, Allocator.Persistent);
//for some reason can't use enum type so cast to int
for (int i = 0; i < a._wallTypes.Length; i++)
Conns.Add((int)a._wallTypes[i], (int)a._connectFlags[i]);
AddComponent<Walls>(e, new()
{
WallGrid = new(gridSize),
ConnectionFlags = Conns
});
How do i correctly set this up?