Quick answer: Unreal Engine 5 MassEntity assert when spawning entities from a worker thread? Entity creation must run on the game thread or via deferred mutation commands - schedule via FMassExecutionContext.Defer.
check(IsInGameThread()) firing from a Mass processor that conceptually runs in parallel. Spawn calls are the trigger.
Defer the mutation
Context.Defer().PushCommand<FMassCommandAddTag>(Entity, FTag::StaticStruct());The deferred queue runs on the game thread after the parallel pass. Use it for any structural change.
Or pin the processor to game thread
Set ExecutionFlags.bRunOnGameThread = true in the processor's ConfigureQueries. You give up parallelism but get to spawn directly.
Group your processors
Use ExecuteAfterGroup/ExecuteBeforeGroup to keep spawn-heavy processors clustered. Mixing parallel and game-thread processors interleaved is where most of these asserts originate.
“Mass parallelism is a contract. Game-thread mutations are the escape hatch, and the queue is how you reach it.”
When in doubt, defer. The deferred queue is fast enough that the overhead doesn't show up in normal profiles.