#Native array causing error

1 messages · Page 1 of 1 (latest)

hardy meadow
#

ArgumentException: Blittable component type 'EnemySpawnpoints' on GameObject 'Game Properties' 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.

What does this mean? This is the code that's causing it:

public struct EnemySpawnpoints : IComponentData
{
    public NativeArray<float3> Points;
}```

commenting out the line fixes the error. Is this a bug? Im experiencing this on entities .14 and .16
dapper basalt
#

you can't bake native containers

#

and you can't query components with native containers in jobs

#

you can get the container on main thread from a component and pass it into the job

#

but you can't have it part of a ijobentity or ijobchunk component you query

hardy meadow
dapper basalt
#

Never worked in builds

#

It worked in editor, broke in builds always

#

The pointer you bake in editor is just pointing to random memory in a build

hardy meadow
#

oohhh

#

what would you suggest?

#

buffers?

#

or something else

dapper basalt
#

just use a dynamicbuffer

#

or if the data is static and just written from baking, you can use a blobarray

hardy meadow
hardy meadow
#

Do I gotta serialise it or wat

#

or is it a bug

#

currently doing

public readonly partial struct GameAspect : IAspect
{  
    //stuff
}```
dapper basalt
#

aspects are just wrappers for components

#

if you have all the components that an aspect requires, you have the aspect

hardy meadow
#

Ik, it puts all my data in a single place, but how come others can see theirs in the aspects tab of their entities

#

whilst I cant

dapper basalt
#

honestly i've never looked at aspect tab

#

and i don't use them much so i can't really help here

hardy meadow
#

I mean, I dont really need to see it Ig, just wanted to see if my stuff was working correctly