Burst error BC1040: Loading from a non-readonly static field is not supported

Is that possible to fix this issue at burst side? Currently I blocked by this burst error.

C:\Project\Library\PackageCache\com.unity.entities@8e13422a93\Unity.Entities\EntityCommandBuffer.cs(1366,13): Burst error BC1040: Loading from a non-readonly static field Unity.Entities.EntityCommandBuffer.ms_CommandBufferIDAllocator is not supported
at Unity.Entities.EntityCommandBuffer…ctor(Unity.Entities.EntityCommandBuffer* this, Unity.Collections.Allocator label, int disposeSentinelStackDepth, Unity.Entities.PlaybackPolicy playbackPolicy) (at C:\Project\Library\PackageCache\com.unity.entities@8e13422a93\Unity.Entities\EntityCommandBuffer.cs:1366)
at Unity.Entities.EntityCommandBuffer…ctor(Unity.Entities.EntityCommandBuffer* this, Unity.Collections.Allocator label) (at C:\Project\Library\PackageCache\com.unity.entities@8e13422a93\Unity.Entities\EntityCommandBuffer.cs:1330)
…

No you cannot load from non-readonly static fields. You can use SharedStatic’s for this usecase though (that is what they were designed for) Advanced Usages | Burst | 1.7.4

:hushed: Actually it’s the EntityCommandBuffer issue from Entities package. Do u have any idea when dots developer will fix it?

If its a DOTS issue then best to ask on their forums! Unity Engine - Unity Discussions

1 Like