Quick answer: Unreal Mass Entity FMassEntityQuery returning zero entities? Missing fragment registration on the archetype, or the query’s required fragments don’t match the archetype’s.
A MassProcessor querying for FAgentFragment finds nothing despite spawning agents. The archetype either doesn’t include the fragment or the query syntax is off.
Archetype Must Include Fragment
Mass archetypes are determined by the fragments at spawn. If your spawner adds FTransformFragment but not FAgentFragment, no query for FAgentFragment will match.
Query Setup in OnInitialize
Query.AddRequirement<FAgentFragment>(EMassFragmentAccess::ReadWrite);
Query.RegisterWithProcessor(*this);Required for the processor to know which fragments to fetch. Missing this is silent.
Tags vs Fragments
Add tag-based filtering separately. Query.AddTagRequirement<FAgentActiveTag> further narrows the matching archetypes — missing a tag silently rejects entities.
Chunk Iteration
Inside Execute, iterate chunks via ForEachEntityChunk. Skipping this loop means your work never runs even when entities match.
Verifying
Enable the Mass debug visualizer (insights category Mass). Your processor’s entity count matches the spawn count each frame.
“Mass queries match archetypes by required fragments. Both ends must agree.”
Mass Insights gives you per-processor entity counts — check there first before sprinkling logs through your processor.