Structs

Reference to creating and implementing structs for gameplay classes.

Choose your operating system:

Windows

macOS

Linux

Structs are data structures that help you organize and manipulate related properties. In the Unreal Engine, they're recognized by the Engine's reflection system, but are not part of the UObject ecosystem. As a result, they are faster to create than a UObject with the same data layout, and support UProperties, but will not be managed by the Garbage Collection system and cannot provide UFunctions. Keep in mind that UStructs cannot be used inside classes.

To make a struct into a UStruct, use the USTRUCT tag above the struct's definition, and include GENERATED_BODY() as the first line within the definition, as follows:

USTRUCT([Specifier, Specifier, ...])
struct FStructName
{
    GENERATED_BODY()
};
This page was written for a previous version of Unreal Engine and has not been updated for the current Unreal Engine 5.1 release.