Burst and NativeQueue

When I turn on Burst Compleer and use NativeQueue , The following error occurs:
:\Users\caomeng\Desktop\DOTSFlowFieldMaster-master\FlowField\Library\PackageCache\com.unity.collections@0.15.0-preview.21\Unity.Collections\NativeQueue.cs(98,17): Burst error BC1042: The managed class type Unity.Collections.NativeQueueBlockPoolData* is not supported. Loading from a non-readonly static field Unity.Collections.NativeQueueBlockPool.pData is not supported

this my code:
NativeQueue indicesToCheck = new NativeQueue(Allocator.Temp);

How to solve this problem

we need a little more code than that.

yes, knowing where that line is, how it’s being passed to the job/burst code, etc. Generally you need to reference your nativeCollection in a local variable or static field before using it. you cant reference it off of a object.

Problem is - you can’t allocate NativeQueue inside jobs, not all containers allowed for that, and NQ not among them

1 Like