Navigation
API > API/Runtime > API/Runtime/MassEntity
Removes any mix of element types from entities. This is the preferred command for element removal. Types are template parameters — uses PushCommand for efficient cross-chunk batching (one Run() for all entities across all chunks that push into this command). Performs a single entity move for all non-sparse types.
When to use: whenever you need to remove fragments, tags, shared fragments, and/or sparse elements from entities and the types are known at compile time. Replaces FMassCommandRemoveFragments and FMassCommandRemoveTags.
Example: // All entities in chunk: Context.Defer().PushCommand
Supported types: all FMassElement subtypes (fragments, tags, shared, const shared, sparse). Breakpoint support: Yes — CheckFragmentRemoveBreakpoints called per entity at PushCommand time. Entity moves: 1 move for all non-sparse types combined. Sparse removal is in-place (no move).
| Name | FMassCommandRemoveElements |
| Type | struct |
| Header File | /Engine/Source/Runtime/MassEntity/Public/MassCommands.h |
| Include Path | #include "MassCommands.h" |
Syntax
template<typename... TTypes>
struct FMassCommandRemoveElements : public FMassBatchedEntityCommand
Inheritance Hierarchy
- FMassBatchedCommand → FMassBatchedEntityCommand → FMassCommandRemoveElements
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMassCommandRemoveElements() |
MassCommands.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Super | FMassBatchedEntityCommand | MassCommands.h |
Functions
Public
Protected Virtual
Overridden from FMassBatchedCommand
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual SIZE_T GetAllocatedSize() |
MassCommands.h | ||
virtual void Run
(
FMassEntityManager& EntityManager |
MassCommands.h |