USTRUCT

Description

USTRUCT is a Macro used in UE4 C++ to specify certain settings and attributes.

Caveats

Replication

Remember that only UPROPERTY variables of USTRUCTs are considered for replication! Read more here!

When you declare a USTRUCT in Unreal Engine you can add a NetSerialize method which is part of the Unreal Engine struct trait system. If you define this method, the engine will use it while serializing and deserializing your struct for networking both during properties replication and RPC.

You can find a lot of documentation about serialization in this source file: Runtime/Engine/Classes/Engine/NetSerialization.h [More information here!]

Garbage Collection

Only variables specified as UPROPERTY will be counted for the purposes of Garbage Collection.

Valid Keywords

Atomic

Indicates that this struct should always be serialized as a single unit.

BlueprintType

Exposes this struct as a type that can be used for variables in Blueprints.

Immutable

Immutable is only legal in Object.h and is being phased out.

Note Do not use on new structs!

NoExport

No autogenerated code will be created for this class; the header is only provided to parse metadata from.

Related

UCLASS, UPROPERTY, USTRUCT, UMETA, UPARAM, UENUM, UDELEGATE