Note: This page is still a work in progress. There are a lot of meta specifiers still to document!
Unreal's Property Specifiers page lists all of the core specifiers and many of the metadata specifiers, but it is not an exhaustive list.
This page attempts to be an exhaustive list of all the UPROPERTY
specifiers,
giving explanations, sample code, screenshots and related links for each.
If you know of any not listed here, or see any mistakes, feel free to contact me.
Special thanks to Erekose Craft, Ben Fox, Aquanox, ATankNoMore for finding meta properties, giving feedback and giving great examples of usage.
The YAML files used to generate this documentation are available on GitHub. Feel free to submit pull requests or submit any incorrect or missing information there.
General Points
- Tags are case insensitive, but I would recommend sticking to the case example here for readability.
- Quotation marks are optional if the values does not have spaces. e.g.
someBool=true
is treated the same assomeBool="true"
. Again, for readability I would recommend using quotation marks only around string-type properties.
Editor
Visibility
UPROPERTY(
VisibleAnywhere
)
Position:
Main
Type:
flag
Incompatible with:
Properties marked with VisibleAnywhere
are visible in the both Details Panel of Blueprint assets and the Details Panel of Blueprint instances within maps.
Note that this refers to being visible in the Details Panel, not visible in the Blueprint Graph. For that you need to use BlueprintReadOnly
.
UPROPERTY(VisibleAnywhere)
int32 VisibleAnywhereNumber;
UPROPERTY(
VisibleDefaultsOnly
)
Position:
Main
Type:
flag
Incompatible with:
"Defaults" in this context means that this property will be visible in Blueprint classes (e.g. the BP_Cat
asset in your content browser), but not instances (e.g. Cat
in your map).
You might want to make a property VisibleDefaultsOnly if it is defined and used in C++, but Blueprint users may want to see the value of it when editing the Blueprint asset itself. It is effectively a way of making a property visible but read-only.
Note that this refers to being visible in the Details panel, not visible through the Blueprint Graph. For that you need to use BlueprintReadOnly
.
UPROPERTY(VisibleAnywhere)
int32 VisibleAnywhereNumber;
UPROPERTY(
VisibleInstanceOnly
)
Position:
Main
Type:
flag
Incompatible with:
This property will only be visible in Blueprint instances, like those that exist in the map.
This is a more rarely-used visibility specifier, but you could maybe use it for showing Blueprint users the values of properties that are defined in C++ or are calculated based on other properties.
Note that this refers to being visible in the Details panel, not visible through the Blueprint Graph. For that you need to use BlueprintReadOnly
.
UPROPERTY(VisibleInstanceOnly)
int32 VisibleInstanceOnlyNumber;
UPROPERTY(
EditAnywhere
)
Position:
Main
Type:
flag
Incompatible with:
Related:
The value of EditAnywhere
properties can be changed in both the Details Panel of Blueprint assets and the Details Panel of Blueprint instances.
Note that this refers to being editable in the Details panel, not visible through the Blueprint Graph. For that you need to use BlueprintReadWrite
.
UPROPERTY(EditAnywhere)
int32 EditAnywhereNumber;
UPROPERTY(
EditInstanceOnly
)
Position:
Main
Type:
flag
You might want to make a property EditInstanceOnly
if it does not make sense to have a default value in the Blueprint asset. For example a ATrigger
actor could point to ADoor
instances within a map and tell them to open when the trigger is activated. In this example it would not make sense to have TArray<ADoor*>
be editable within the Blueprint asset, so you could use EditInstanceOnly
.
Note that this refers to being editable in the Details panel, not visible through the Blueprint Graph. For that you need to use BlueprintReadWrite
.
UPROPERTY(EditInstanceOnly)
int32 EditInstanceOnlyNumber;
UPROPERTY(
EditDefaultsOnly
)
Position:
Main
Type:
flag
Incompatible with:
Related:
UPROPERTY(EditDefaultsOnly)
int32 EditDefaultsOnlyNumber;
UPROPERTY(meta=(
HideInDetailPanel
))
Not sure this is very useful for anything. Events are not really shown in a useful way in the details panel. The green + shape button that is shown on UButton
is a UMG-specific editor customization so this does not relate to showing events in that way.
UPROPERTY(meta=(
ShowOnlyInnerProperties
))
Position:
Meta
Type:
flag
Useful when you want to avoid making users click to expand an struct, for example when it is the only thing inside an outer class.
Does not work for arrays.
USTRUCT()
struct FCat
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
FString Name;
UPROPERTY(EditDefaultsOnly)
int32 Age;
UPROPERTY(EditDefaultsOnly)
FLinearColor Color;
};
// ...
UPROPERTY(EditAnywhere, Category="Cat Without ShowOnlyInnerProperties")
FCat Cat;
UPROPERTY(EditAnywhere, Category="Cat With ShowOnlyInnerProperties", meta=(ShowOnlyInnerProperties))
FCat Cat;
Display
UPROPERTY(
Category
="abc")
Position:
Main
Type:
string
Using Category
, it's possible to group properties together into expandable folders. The pipe character |
can be used to create sub-folders. For example Category="Character Info|Health"
would create two folders: Character Info
, and within that, Health
.
The categories are also used when searching for properties within the Blueprint graph, if they are exposed with BlueprintReadOnly
or BlueprintReadWrite
.
Note that whitespace is important; if there are two properties one marked with Category="Parent|Child"
and one with Category="Parent | Child"
, it will result in two folders being displayed.
UPROPERTY(EditAnywhere, Category="Animals")
bool bIsCute;
UPROPERTY(EditAnywhere, Category="Animals|Dogs")
FString BarkWord;
UPROPERTY(EditAnywhere, Category="Animals|Birds")
int32 FlyingSpeed = 99;
UPROPERTY(meta=(
DisplayName
="abc"))
Position:
Meta
Type:
string
Changes the text label used with the property. This is used both in the Details panel and for
Useful when there are internal programmer-only technical terms that do not need to be shown to the user.
UPROPERTY(EditAnywhere, meta=(DisplayName="Display Font"))
FSoftObjectPath DisplayFontPath;
UPROPERTY(meta=(
ToolTip
="abc"))
Position:
Meta
Type:
string
Show a tooltip with this text when mousing over the property.
UPROPERTY(EditAnywhere, meta=(ToolTip="Something that's shown when hovering."))
int32 Legs;
UPROPERTY(
AdvancedDisplay
)
Any properties with AdvancedDisplay
are hidden under a section that is opened with a dropdown arrow.
Useful for separating properties that are rarely used or only useful to advanced users.
UPROPERTY(EditAnywhere, Category="Toy")
FString Name;
UPROPERTY(EditAnywhere, Category="Toy")
int32 HappyPhraseCount;
UPROPERTY(EditAnywhere, Category="Toy", AdvancedDisplay)
bool bEnableEvilMode;
UPROPERTY(
SimpleDisplay
)
UPROPERTY(meta=(
ShowInnerProperties
))
Seems to be used for object references, whereas ShowOnlyInnerProperties
is used for Structs? EditInline
or Instanced
seems to be co-occurrent.
UPROPERTY(meta=(
FullyExpand
=true))
UPROPERTY(meta=(
EditCondition
="abc"))
EditCondition
can be used to change a property from read-only to writeable depending on another property.
The simplest way is simply using another bool
property, but as of 4.23 more complex statements are supported.
It is worth noting that EditCondition
also changes the appearance of properties inside Blueprint logic Make Struct nodes.
UPROPERTY(EditAnywhere)
bool bCanFly;
UPROPERTY(EditAnywhere, meta=(EditCondition="bCanFly"))
float MaxFlightSpeed;
UENUM()
enum class EAnimalType
{
Bird,
Fish
};
UPROPERTY(EditAnywhere)
EAnimalType AnimalType;
UPROPERTY(EditAnywhere, meta=(EditCondition="AnimalType==EAnimalType::Bird"))
float MaxFlightSpeed;
UPROPERTY(EditAnywhere, meta=(EditCondition="AnimalType==EAnimalType::Fish"))
float MaxSwimSpeed;
UPROPERTY(meta=(
HideEditConditionToggle
))
UPROPERTY(meta=(
EditConditionHides
))
By default, EditCondition
changes properties to be read-only when the condition evaluates to false. With EditConditionHides
, the property is hidden. I find this useful for hiding larger groups of properties.
UENUM()
enum class EPlantType
{
Flower,
Food,
Poison
};
UPROPERTY(EditDefaultsOnly)
EPlantType PlantType = EPlantType::Flower;
UPROPERTY(EditDefaultsOnly, meta=(EditCondition="PlantType==EPlantType::Flower", EditConditionHides))
FLinearColor FlowerColor = FLinearColor::White;
UPROPERTY(EditDefaultsOnly, Category="Food", meta=(EditCondition="PlantType==EPlantType::Food", EditConditionHides))
int32 FoodAmount = 1;
UPROPERTY(EditDefaultsOnly, meta=(EditCondition="PlantType==EPlantType::Poison", EditConditionHides))
float PoisonDamagePerSecond = 0.25f;
UPROPERTY(meta=(
InlineEditConditionToggle
))
Position:
Meta
Type:
flag
Requires:
Incompatible with:
Opposite:
Related:
Instead of showing the bool
property separately, it is instead displayed inline, to the left of the property that it is controlling.
Note that this meta flag should be put on the bool
property, not the property with the EditCondition
UPROPERTY(EditAnywhere, meta=(InlineEditConditionToggle))
bool bCanFly;
UPROPERTY(EditAnywhere, meta=(EditCondition="bCanFly", Units="s"))
float FlapPeriodSeconds;
UPROPERTY(meta=(
DisplayAfter
="abc"))
Position:
Meta
Type:
string (Property name)
Related:
Multiple properties with DisplayAfter that refer to the same property will be displayed in the order they are defined.
UPROPERTY(EditAnywhere, meta=(DisplayAfter="ShowFirst"))
int32 ShowAfterFirst1;
UPROPERTY(EditAnywhere, meta=(DisplayAfter="ShowFirst"))
int32 ShowAfterFirst2;
UPROPERTY(EditAnywhere)
int32 ShowFirst;
UPROPERTY(EditAnywhere)
int32 ShowNext;
UPROPERTY(meta=(
DisplayPriority
=123))
Position:
Meta
Type:
integer
Related:
Changes the order in which properties are shown within a category. Properties with lower numbers are shown before those with higher numbers.
Properties without a DisplayPriority
tag are given a default value of MAX_int32
and displayed after all properties with a tag.
Negative values are allowed.
Internally is converted from a string to an integer with FCString::Atoi
.
UPROPERTY(EditAnywhere, meta=(DisplayPriority=3))
int32 Priority3;
UPROPERTY(EditAnywhere, meta=(DisplayPriority=2))
int32 Priority2
UPROPERTY(EditAnywhere, meta=(DisplayPriority=0))
int32 Priority0;
UPROPERTY(EditAnywhere)
int32 NoPriority;
UPROPERTY(EditAnywhere, meta=(DisplayPriority=-1)
int32 PriorityNegative1;
UPROPERTY(meta=(
DisplayThumbnail
=true))
Position:
Meta
Type:
bool
Related:
Can also be used as metadata on UCLASS()
.
UPROPERTY(EditAnywhere, meta=(DisplayThumbnail=false))
class UCurveFloat* SomeCurve;
UPROPERTY(EditAnywhere, meta=(DisplayThumbnail=true))
TSoftObjectPtr<USkeletalMesh> AnimalMesh;
UPROPERTY(meta=(
MaxPropertyDepth
=123))
You can use this to limit the depth to which nested properties are shown. It might be useful if you have structs within structs within structs to an extreme degree.
No examples of this in the source code as far as I can tell.
Undo and Redo
UPROPERTY(
NonTransactional
)
Position:
Main
Type:
flag
Misc
UPROPERTY(meta=(
ForceRebuildProperty
="abc"))
Seems to find a child property node with the specified string, and if found, force them to be rebuilt
UPROPERTY(
Instanced
)
Position:
Main
Type:
flag
Related:
UCLASS(EditInlineNew, DefaultToInstanced, CollapseCategories)
class UBeamInstanceSettings : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere)
int32 MyOption;
};
UCLASS()
class ABeamTrackEmitter : public AActor
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintReadOnly, Instanced)
UInstanceSettings* Settings;
};
UPROPERTY(meta=(
ExposeFunctionCategories
="abc"))
Position:
Meta
Type:
string (`UFUNCTION` category names?)
Seems to be used for exposing components within actors.
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(ExposeFunctionCategories="PointLight,Rendering|Lighting"))
TObjectPtr<class UPointLightComponent> PointLightComponent;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta=(ExposeFunctionCategories = "Mesh,Rendering,Physics,Components|StaticMesh", AllowPrivateAccess = "true"))
class UStaticMeshComponent* StaticMeshComponent;
Internal and Deprecated
UPROPERTY(meta=(
EditInline
))
Using this shows the error "EditInline
is deprecated. Remove it, or use Instanced
instead."
UPROPERTY(EditAnywhere, meta=(EditInline))
UDog* Dog;
UPROPERTY(
RepRetry
)
Position:
Main
Type:
flag
As of Unreal 5.0 Early Access 2, RepRetry is marked as deprecated.
UPROPERTY(
Localized
)
Position:
Main
Type:
flag
This is mentioend in the documentation, but it's deprecated. And it's not used anywhere in the engine. If you're looking for localization stuff start with FText
.
UPROPERTY(meta=(
FixedIncrement
=123))
Position:
Meta
Type:
integer
Related:
Probably superceded by Delta?
UPROPERTY(meta=(
NeedsLatentFixup
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
LatentCallbackTarget
))
Position:
Meta
Type:
flag
Data Decorators
General
UPROPERTY(meta=(
NoResetToDefault
))
Position:
Meta
Type:
flag
This hides the little return arrow that is shown to reset a value back to the value defined in the parent Blueprint or C++ class. This can be especially useful for large structs or arrays, where you would want to avoid people being able to accidentally wipe the entire contents.
UPROPERTY(EditAnywhere, meta=(NoResetToDefault))
int32 NoResetToDefault = 1;
UPROPERTY(EditAnywhere)
int32 HasResetToDefault = 1;
Numeric
UPROPERTY(meta=(
ClampMin
=123))
ClampMax
and ClampMin
force numbers entered into the property to be clamped within the specified range.
In comparison, UIMax
and UIMin
stop the number from going outside the bounds when the user drags their mouse, but still allows them to type in a number outside the UIMin
/UIMax
range.
UPROPERTY(EditAnywhere, meta=(ClampMin=1))
int32 MaxHP;
UPROPERTY(meta=(
ClampMax
=123))
ClampMax
and ClampMin
force numbers entered into the property to be clamped within the specified range.
In comparison, UIMax
and UIMin
stop the number from going outside the bounds when the user drags their mouse, but still allows them to type in a number outside the UIMin
/UIMax
range.
UPROPERTY(EditAnywhere, meta=(ClampMin=0, ClampMax=100))
int32 RestoreHealthPercent;
UPROPERTY(meta=(
UIMin
=123))
Setting UIMin
stops the user being able to drag the property lower than the specified number. The user can however set the number lower than this value by typing it in. Most of the time it makes sense to use both UIMin
and ClampMin
.
UPROPERTY(meta=(UIMin=0, UIMax=100))
int32 PercentScore;
UPROPERTY(meta=(
UIMax
=123))
UPROPERTY(meta=(UIMin=0, UIMax=100))
int32 PercentScore;
UPROPERTY(meta=(
NoSpinbox
=true))
Position:
Meta
Type:
bool
Without this flag, when mousing over a property input box the cursor will change to show arrows, allowing the user to click and drag to change the value in the input box.
This flag stops that happening.
Note that this is a bool not a flag.
UPROPERTY(meta=(
SliderExponent
=123))
UPROPERTY(meta=(
Delta
=123))
Changes the amount that the number changes when dragging. This does not perform any validation, the user is still free to manually enter a number that is not a multiple of the value. To perform validation, use the Multiple
tag.
// Dragging this will make it step up in increments of 12
UPROPERTY(meta=(Delta=12))
int32 TotalEggs;
UPROPERTY(meta=(
Multiple
=123))
Position:
Meta
Type:
number (float, int)
Related:
UPROPERTY(meta=(Multiple=12, Delta=12))
int32 TotalEggs;
UPROPERTY(meta=(
Units
="abc"))
Sets a unit to be shown after the number. For all possible values see the TEXT
entries in FParseCandidates
inside UnitConversion.cpp
. Using an unknown value will result in a compile error. Many units have mutliple aliases, for example "Kilometers" and "km" will result in the same unit being used. Units are case-insensitive. Units
also allows users to input in related units. Entering 100f
into a field with Units="Celsius"
results in 37.77779 °C
.
UPROPERTY(EditAnywhere, meta=(Units="Celsius"))
float CookingTemperature;
UPROPERTY(EditAnywhere, meta=(Units="Kilograms"))
float TigerWeight;
UPROPERTY(EditAnywhere, meta=(Units="GB"))
float DiskSpace;
UPROPERTY(EditAnywhere, meta=(Units="Percent"))
float Happiness;
UPROPERTY(EditAnywhere, meta=(Units="times"))
float Deliciousness;
UPROPERTY(meta=(
ForceUnits
="abc"))
UPROPERTY(meta=(
ArrayClamp
="abc"))
UPROPERTY(meta=(
ValidEnumValues
="abc"))
Restricts the allowed enum values to those listed in the string.
UENUM()
enum class EBodyPartType : uint8
{
Head,
Body,
LeftArm,
RightArm,
LeftLeg,
RightLeg,
};
UPROPERTY(EditAnywhere, meta=(ValidEnumValues="LeftArm, RightArm"))
EBodyPartType GloveSlot;
UPROPERTY(meta=(
InvalidEnumValues
="abc"))
Disallows listed enum values from being chosen.
Text
UPROPERTY(meta=(
GetOptions
="abc"))
Position:
Meta
Type:
string (function name)
Related:
Generates a dropdown instead of a text box for the FName
/FString
/TArray<FString>
/TArray<FString>
/TMap
with an FName
or FString
property. The contents of the dropdown are populated by the results of the function.
For specifying options for Keys or Values within a TMap
, look at GetKeyOptions
and GetValueOptions
.
The function is called once on opening the Blueprint in the editor, and then every time the user clicks the drop-down.
Note the documentation mentions to always return TArray<FString>
even if the property is FName
. But it seems to work even if you return TArray<FName>
. Examples in the engine codebase return const TArray<FString>&
rather than just plain TArray<FString>
but either seems to work.
The function that returns the array of options must be a UFUNCTION()
or it will not work. The editor searches through the hierarchy of owning objects for the UPROPERTY()
, using the first UFUNCTION
it finds with a matching names. This means that USTRUCT
s can use functions defined in owning UObject
s, where USTRUCT
s would not normally be able to contain UFUNCTION
S
GetOptions
also supports external static function references via Module.Class.Function
syntax. If the function name contains a .
, it is assumed to be static and the editor will crash if it is not.
UPROPERTY(meta=(GetOptions="GetAnimalOptions"))
FString Animal;
UFUNCTION()
TArray<FString> GetAnimalOptions() const
{
return { "Cat", "Dog", "Elephant" };
}
UPROPERTY(meta=(GetOptions="GetSocketNames"))
TArray<FName> AttachSocketNames;
UFUNCTION()
TArray<FString> GetSocketNames() const
{
TArray<FString> SocketNames;
// Get skeletal mesh, populate list of socket names
return SocketNames;
}
USTRUCT()
struct FPlantEntry
{
GENERATED_BODY()
// This calls the UFUNCTION in the owning UGarden
UPROPERTY(meta=(GetOptions="GetPlantTypeNames"))
FString PlantTypeName;
};
UCLASS()
class UGarden : public UObject
{
GENERATED_BODY()
UPROPERTY()
TArray<FPlantEntry> Plants;
UFUNCTION()
TArray<FString> GetPlantTypeNames();
}
UPROPERTY(meta=(
GetKeyOptions
="abc"))
Position:
Meta
Type:
string (function name)
Related:
Use to limit what are acceptable string values for the key values of a TMap<FText, ...>
, TMap<FString, ...>
or TMap<FName, ...>
.
See the GetOptions
documentation for details.
UPROPERTY(meta=(
GetValueOptions
="abc"))
Position:
Meta
Type:
string (function name)
Related:
Use to limit what are acceptable string values for the value values of a TMap<..., FText>
, TMap<..., FString>
or TMap<..., FName>
.
See the GetOptions
documentation for details.
UPROPERTY(meta=(
MultiLine
=true))
Position:
Meta
Type:
bool
Shows a text box that will grow as the user adds multiple lines. Use Shift+Enter
to enter a newline character.
Note that this is not a flag property but a bool property. meta=(MultiLine)
won't do anything. It has to be meta=(MultiLine=true)
UPROPERTY(EditAnywhere, meta=(MultiLine=true))
FText SomeLongText;
UPROPERTY(meta=(
PasswordField
=true))
Position:
Meta
Type:
bool
Note that this is not a flag property but a bool property. meta=(PasswordField)
won't do anything. It has to be meta=(PasswordField=true)
UPROPERTY(EditAnywhere, meta=(PasswordField=true))
FString ShhSecret;
Array
UPROPERTY(meta=(
ArraySizeEnum
))
Replaces the indices on statically-created arrays with those from a UENUM()
. Note that the "add element" button is hidden. Works with UMETA(Hidden)
.
UENUM()
enum class EArmorSlots
{
Head,
LeftArm,
RightArm,
Tummy UMETA(Hidden),
LeftLeg,
RightLeg,
Num UMETA(Hidden)
};
UPROPERTY(EditAnywhere, meta=(ArraySizeEnum="EArmorSlots"))
FColor ColorForSlot[EArmorSlots::Num];
UPROPERTY(
EditFixedSize
)
Position:
Main
Type:
flag
Related:
Not sure the best place to initialize the contents of a EditFixedSize-marked TArray
but it seems to work in the constructor.
UMyObject() {
FixedSize = { "Hello", "World" };
}
UPROPERTY(EditAnywhere, meta=(EditFixedSize))
TArray<FString> FixedSize;
UPROPERTY(meta=(
EditFixedOrder
))
UPROPERTY(EditAnywhere, meta=(EditFixedOrder))
TArray<FString> FixedOrderNames;
UPROPERTY(meta=(
TitleProperty
="abc"))
When displaying an array of structs, TitleProperty
allows you to customize a text that is used in the right-hand column to summarize each entry in the array. The title can be built from any of the struct properties that have GetName()
. So any FString
, FName
, float
, int32
, FGameplayTag
properties would usable as a title for array elements.
As of Unreal 5.0, you can use FText::Format
-like formatting to output multiple parts of structs in the array. See the FDogMapping
example below.
USTRUCT()
struct FCat
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
FString Name;
UPROPERTY(EditDefaultsOnly)
int32 Age;
UPROPERTY(EditDefaultsOnly)
FLinearColor Color;
};
// Then in another location, making an array of FCats
UPROPERTY(EditAnywhere, meta=(TitleProperty="Name"))
TArray<FCat> Cats;
USTRUCT()
struct FDogMapping
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly)
FString Name;
UPROPERTY(EditDefaultsOnly)
int32 Age;
UPROPERTY(EditDefaultsOnly)
TSoftClassPtr<AActor> ActorClass;
};
// Unreal 5.0 onwards supports FText-like formatting
UPROPERTY(EditAnywhere, meta=(TitleProperty="{Name} ({Age}) spawns {ActorClass}"))
TArray<FDogMapping> DogMappings;
UPROPERTY(meta=(
NoElementDuplicate
))
Requires operator==
and WithEquality
to work with structs.
Definitely does not work with simple data types like integers and strings.
UPROPERTY(EditAnywhere, meta=(NoElementDuplicate))
TArray<TObjectPtr<class AActor>> NoDuplicatedActors;
Color
UPROPERTY(meta=(
HideAlphaChannel
))
Position:
Meta
Type:
flag
Works for both FColor
and FLinearColor
properties. The alpha property is hidden both in the details panel and in the Color Picker window.
Object
UPROPERTY(
NoClear
)
Position:
Main
Type:
flag
UPROPERTY(EditAnywhere)
TSubclassOf<UObject> ObjectWithClear;
UPROPERTY(EditAnywhere, NoClear)
TSubclassOf<UObject> ObjectNoClear;
Bitmask
UPROPERTY(meta=(
Bitmask
))
Shows a dropdown box containing all bitmask options. Clicking on them enables or disables that flag.
UENUM(meta = (Bitflags, UseEnumValuesAsMaskValuesInEditor = "true"))
enum class EAnimalFlags : uint8
{
CanFly = 1 << 0,
CanSwim = 1 << 1,
CanLayEggs = 1 << 2,
};
ENUM_CLASS_FLAGS(EAnimalFlags)
// Data type can be flag or int32
UPROPERTY(EditDefaultsOnly, meta = (Bitmask, BitmaskEnum = EAnimalFlags))
int32 AnimalFlags;
UPROPERTY(meta=(
BitmaskEnum
="abc"))
Position:
Meta
Type:
string
Related:
See Bitmask.
Vector
UPROPERTY(meta=(
AllowPreserveRatio
))
Position:
Meta
Type:
flag
Shows a preserve ratio lock to the right of the property input boxes. Clicking the lock will enable/disable ratio lock. As far as I can tell it only works with vector types: FIntPoint
, FVector
, FVector2D
, FVector4
.
Probably most useful for vector properties that are used for scaling.
UPROPERTY(EditAnywhere, meta=(AllowPreserveRatio))
FVector CustomScale;
UPROPERTY(meta=(
MakeEditWidget
))
Position:
Meta
Type:
flag
This shows a kind of janky-looking wireframe diamond in-world at an offset relative to the parent actor. It also shows some debug text. See the screenshot.
A lot of examples seem to treat this like a boolean, but it's a flag; it just checks for HasMetaData
.
UPROPERTY(EditAnywhere, meta=(MakeEditWidget))
FVector SomePosition;
TMap
UPROPERTY(meta=(
ReadOnlyKeys
))
Position:
Meta
Type:
flag
Makes TMap
keys read-only in the editor (if you fill them in the CDO).
UPROPERTY(meta=(
ForceInlineRow
))
Position:
Meta
Type:
flag
Show key-value TMaps in a table format.
UPROPERTY(EditAnywhere)
TMap<FGameplayTag, int32> Stats;
UPROPERTY(EditAnywhere, meta=(ForceInlineRow))
TMap<FGameplayTag, int32> StatsInlineRow;
Serialization
UPROPERTY(
SaveGame
)
Position:
Main
Type:
flag
Variables marked with SaveGame
will be serialized by a USaveGame
object
UPROPERTY(SaveGame)
TArray<FString> FriendNames;
UPROPERTY(
SerializeText
)
Position:
Main
Type:
flag
UPROPERTY(
SkipSerialization
)
Position:
Main
Type:
flag
UPROPERTY(
Transient
)
Position:
Main
Type:
flag
UPROPERTY(
DuplicateTransient
)
Position:
Main
Type:
flag
UPROPERTY(meta=(
TransientToolProperty
))
Position:
Meta
Type:
flag
Related:
Properties with this meta flag are in UInteractiveToolPropertySet::SaveRestoreProperties
. Is often used to mark properties that are used as edit conditions or properties that are used to fill GetOptions results.
UPROPERTY(
NonPIEDuplicateTransient
)
Position:
Main
Type:
flag
UPROPERTY(
TextExportTransient
)
Position:
Main
Type:
flag
Blueprint Logic
UPROPERTY(
BlueprintReadOnly
)
BlueprintReadOnly
and its sibling BlueprintReadWrite
Allow
By default, variables marked with BlueprintReadOnly
or BlueprintReadWrite
cannot be private
(i.e. they must be protected
or public
). However the AllowPrivateAccess
meta flag can change this to allow private
variables.
It seems possible to mark a property with both BlueprintReadOnly
and BlueprintGetter
, though I assume that only the Getter is called and the BlueprintReadOnly
is redundant.
UPROPERTY(
BlueprintReadWrite
)
UPROPERTY(
BlueprintGetter
="abc")
Position:
Main
Type:
string (UFUNCTION name)
Related:
The UFUNCTION
used by BlueprintGetter
must be a pure function marked with const
and BlueprintGetter
(or technically BlueprintPure
seems to work too).
If you end up with an error message like error: use of undeclared identifier 'Mode'
Make sure your property and functions do not have clashing names. You cannot call your property bIsPasswordEnabled
and the getter function bool IsPasswordEnabled() const
UPROPERTY(EditAnywhere, BlueprintGetter = IsPassEnabled, BlueprintSetter = SetPassEnabled )
bool bEnabled = true;
UFUNCTION(BlueprintGetter)
bool IsPassEnabled() const;
UFUNCTION(BlueprintSetter)
void SetPassEnabled(bool bSetEnabledTo = true);
UPROPERTY(
BlueprintSetter
="abc")
Position:
Main
Type:
string
Related:
I haven't used these but I guess this is an alternative to using BlueprintReadWrite
. Allowing BP to set the value of the variable through a function allows for validation and breakpoints.
UPROPERTY(EditAnywhere, BlueprintGetter = IsPassEnabled, BlueprintSetter = SetPassEnabled )
bool bEnabled = true;
UFUNCTION(BlueprintGetter)
bool IsPassEnabled() const;
UFUNCTION(BlueprintSetter)
void SetPassEnabled(bool bSetEnabledTo = true);
UPROPERTY(meta=(
AllowPrivateAccess
=true))
Position:
Meta
Type:
bool
private:
UPROPERTY(BlueprintReadOnly, meta=(AllowPrivateAccess=true))
int32 PrivateReadOnlyInt;
UPROPERTY(BlueprintReadWrite, meta=(AllowPrivateAccess=true))
int32 PrivateReadWriteInt;
UPROPERTY(meta=(
MakeStructureDefaultValue
="abc"))
There's only one example of this in the codebase, inside NoExportTypes.h
. Not sure how this is different from just doing a C11-style FVector Scale3D = FVector(1,1,1)
.
UPROPERTY(EditAnywhere, meta=(MakeStructureDefaultValue = "1,1,1"))
FVector Scale3D;
UPROPERTY(meta=(
ExposeOnSpawn
=true))
Position:
Meta
Type:
bool ((see commment))
Requires:
Incompatible with:
When using SpawnActor
or Construct Object
from Blueprints, marking a property with ExposeOnSpawn
will cause it to be shown in the same node. Useful for variables you often want to set up when creating an Actor or Object.
You must mark ExposeOnSpawn
properties as either BlueprintReadOnly
or BlueprintReadWrite
. It doesn't seem to matter which for the purposes of ExposeOnSpawn
. If you add ExposeOnSpawn
without BlueprintReadOnly
or BlueprintReadWrite
, the UBT shows an error mentioning BlueprintVisible
but I guess this is a generic term for both BlueprintReadOnly
and BlueprintReadWrite
.
Some editor code that uses this meta flag checks for non-null string, some checks for \"true\"
for truthiness. Some examples in the codebase use it like a flag, others like a bool. I would recommend to treat it like a bool.
UPROPERTY(BlueprintReadOnly, meta=(ExposeOnSpawn=true))
int32 StartingHealth = 200;
UPROPERTY(BlueprintReadWrite, meta=(ExposeOnSpawn=true))
int32 StartingCash = 200;
Events
UPROPERTY(
BlueprintAssignable
)
Position:
Main
Type:
flag
Related:
UPROPERTY(
BlueprintAuthorityOnly
)
Position:
Main
Type:
flag
UPROPERTY(
BlueprintCallable
)
Position:
Main
Type:
flag
UPROPERTY(meta=(
IsBindableEvent
=true))
Position:
Meta
Type:
bool
The same thing works if your propriety has "Event" or name, but the metadata is prefeered. Also there's nothing on code requiring the bool, but the engine always uses as a bool.
DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam(UWidget*, FGenerateWidgetEvent, FName, Item);
UPROPERTY(EditAnywhere, Category = Events, meta = (IsBindableEvent = "True"))
FGenerateWidgetEvent OnGenerateContentWidget;
Deprecation
UPROPERTY(meta=(
DeprecatedProperty
))
Marking a property with DeprecatedProperty
and DeprecationMessage
causes a warning to be shown when compiling a Blueprint that uses the variable.
It seems that without DeprecationMessage
, there is no warning shown. So make sure you add one.
In the Unreal codebase I've seen a lot of instances of renaming the variable with a prefix DEPRECATED_
and using DisplayName
to make it look the same to Blueprints.
// Simple
UPROPERTY(BlueprintReadWrite, meta=(DeprecatedProperty, DeprecationMessage="This is deprecated"))
FString PlantName;
// Better
UPROPERTY(BlueprintReadWrite, meta=(DisplayName="PlantName", DeprecatedProperty, DeprecationMessage="PlantName is deprecated, instead use PlantDisplayName."))
FString DEPRECATED_PlantName;
UPROPERTY(meta=(
DeprecationMessage
="abc"))
Position:
Meta
Type:
string
UPROPERTY(meta=(
DisallowedClasses
="abc"))
Network
UPROPERTY(
Replicated
)
Replication and multiplayer in general is a massive topic but some quick poitns:
Marking a property as Replicated
is not enough on its own. In the .cpp
you also need to define a GetLifetimeReplicatedProps
function (see example).
#pragma once
# include "MyReplicatedThing.generated.h"
// MyReplicatedThing.h
UCLASS()
class UMyReplicatedThing
{
GENERATED_BODY()
protected:
UPROPERTY(Replicated)
int32 Count;
};
// MyReplicatedThing.cpp
#include "MyReplicatedThing.h"
#include "Net/UnrealNetwork.h"
void UMyReplicatedThing::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(UMyReplicatedThing, Count);
}
UPROPERTY(
NotReplicated
)
Can be useful to on properties within structs where part should be replicated and others should not (see the example below).
USTRUCT()
struct FMyStruct
{
GENERATED_BODY()
UPROPERTY()
int32 WillReplicate;
UPROPERTY(NotReplicated)
int32 DoNotReplicateMe;
}
UCLASS()
class UMyReplicatedThing
{
GENERATED_BODY()
protected:
UPROPERTY(Replicated)
FMyStruct SomeData;
};
UPROPERTY(
ReplicatedUsing
="abc")
Requires definition of the same GetLifetimeReplicatedProps
function described in Replicated
.
There are technically three different valid signatures for the UFUNCTION
, shown in the 3 code samples below.
UPROPERTY(ReplicatedUsing = OnRep_PlayerName)
FString PlayerName;
UFUNCTION()
void OnRep_PlayerName();
UPROPERTY(ReplicatedUsing = OnRep_PlayerName)
FString PlayerName;
UFUNCTION()
void OnRep_PlayerName(FString OldName);
UPROPERTY(ReplicatedUsing = OnRep_PlayerName)
FString PlayerName;
UFUNCTION()
void OnRep_PlayerName(const FString& OldName);
UMG
UPROPERTY(meta=(
BindWidget
))
Allows C++ code to access UWidget
variables defined in UUserWidget
Blueprint. If that makes no sense, check out this tutorial
Technically what happens is widgets within the UserWidget Blueprint's widget tree are bound to matching UPROPERTY(meta=(BindWidget))
variables. See UWidgetBlueprintGeneratedClass::InitializeBindingsStatic
for the gory details.
UPROPERTY(meta=(BindWidget))
UImage* CharacterPortrait;
UPROPERTY(meta=(
BindWidgetOptional
))
When a BindWidget
-specified widget is not found, an error is thrown on compilation. When a BindWidgetOptional
-specified widget is not found, only an information-level log entry is displayed. Use it for widgets that your User Widget does not require to work. Note you will need to use nullptr
checks to see if the widget exists in the Blueprint.
UPROPERTY(meta=(BindWidgetOptional))
UImage* CharacterPortrait;
UPROPERTY(meta=(
BindWidgetAnim
))
Allows C++ code to call widget animations defined in a child User Widget Blueprint. The name of the animation must match the variable.
See UWidgetBlueprintGeneratedClass::BindAnimations
for more of the juicy details.
UPROPERTY(meta=(BindWidgetAnim))
UWidgetAnimation* RevealWindow;
UPROPERTY(meta=(
BindWidgetAnimOptional
))
The same as BindWidgetAnim
but no error is thrown when the animation does not exist in the User Widget blueprint
UPROPERTY(meta=(BindWidgetAnimOptional))
UWidgetAnimation* RevealWindow;
Data Table
UPROPERTY(meta=(
DataTableImportOptional
=true))
Position:
Meta
Type:
bool
UPROPERTY(meta=(
RequiredAssetDataTags
="abc"))
Position:
Meta
Type:
string
Only shows data table assets with the specified row structure class.
UPROPERTY(EditDefaultsOnly, meta=(RequiredAssetDataTags="RowStructure=ImageRow"))
class UDataTable* ImageSetTable;
UPROPERTY(meta=(
RowType
="abc"))
Position:
Meta
Type:
string
Only allows selecting a data table row with a specific type.
UPROPERTY(EditDefaultsOnly, meta=(RowType="ImageRow"))
class UDataTable* ImageSetTable;
Console
UPROPERTY(meta=(
ConsoleVariable
="abc"))
Exposes a variable to the developer console (accessible through the tilde key ~
).
Heavily used in developer settings.
UPROPERTY(config, EditAnywhere, meta=(ConsoleVariable="r.Shadow.Funky"))
bool bEnableFunkyShadows = true;
Blueprint
UPROPERTY(meta=(
BlueprintCompilerGeneratedDefaults
))
Position:
Meta
Type:
flag
Pickers
Class
UPROPERTY(meta=(
MetaClass
="abc"))
Some datatypes like FSoftClassPath
and FSoftObjectPath
are not templated and allow any class type. MetaClass
lets users allow only certain classes. In comparison TSoftClassPtr
and TSoftObjectPtr
use template parameters instead of MetaClass
.
UPROPERTY(EditAnywhere, meta=(MetaClass="UserWidget"))
FSoftClassPath WidgetToCreate;
UPROPERTY(config, EditAnywhere, meta=( MetaClass="DPICustomScalingRule" ))
FSoftClassPath CustomScalingRuleClass;
UPROPERTY(meta=(
AllowedClasses
="abc"))
Position:
Meta
Type:
string (comma-separated list of classes)
Opposite:
Related:
Not sure how this is different to MetaClass. Note that the string must not contain prefixes, so "Actor" is correct, "AActor" is incorrect. This does work with interfaces.
UPROPERTY(meta=(
AllowAbstract
))
Position:
Meta
Type:
flag
Related:
By default class pickers do not include abstract classes in their list of options. This changes that behaviour to include them. Could be useful when being able to instantiate the specified class is not important.
UPROPERTY(EditAnywhere, meta=(AllowAbstract=true))
TSubclassOf<UUserWidget> ParentClass;
UPROPERTY(meta=(
MustImplement
="abc"))
Position:
Meta
Type:
string (Interface name without `I` prefix.)
UPROPERTY(EditAnywhere, meta=(MustImplement="InteractibleInterface"))
TSubclassOf<AActor> InteractibleActor;
UPROPERTY(meta=(
ShowTreeView
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
BlueprintBaseOnly
))
Position:
Meta
Type:
flag
Related:
UPROPERTY(EditAnywhere, meta=(BlueprintBaseOnly, AllowAbstract))
TSubclassOf<class UObject> ParentClass;
UPROPERTY(meta=(
ExactClass
))
UPROPERTY(meta=(
OnlyPlaceable
))
Position:
Meta
Type:
flag
UPROPERTY(EditAnywhere, meta=(OnlyPlaceable))
TSubclassOf<AActor> ActorToSpawn;
UPROPERTY(meta=(
DisallowCreateNew
))
Position:
Meta
Type:
flag
On any property that points to a class (e.g. TSubclassOf<T>
, UClass*
, FSoftClassPath
), this causes the "Create New" plus button to be hidden.
Component
UPROPERTY(meta=(
AllowAnyActor
))
UPROPERTY(EditAnywhere, meta = (UseComponentPicker, AllowAnyActor))
FComponentReference ComponentRef;
UPROPERTY(meta=(
UseComponentPicker
))
Position:
Meta
Type:
flag
Related:
Use with FComponentReference
properties.
Only works on components attached to actor instances in levels. Does not work when editing a Blueprint subclass.
UPROPERTY(EditAnywhere, meta = (UseComponentPicker, AllowAnyActor))
FComponentReference ComponentRef;
Gameplay Tags
UPROPERTY(meta=(
Categories
="abc"))
Position:
Meta
Type:
string (comma-separated list of gameplay tags)
This allows you to limit which gameplaytags are allowed to be chosen for a FGameplayTag
property. Multiple tags can be specified with commas separating them.
Can also be used on UPARAM
to limit the Gameplay Tags allowed on a UFUNCTION()
There are examples in the engine of it being used with FGameplayTag
, FGameplayTagQuery
, FGameplayTagContainer
, TArray<FGameplayTag>
UPROPERTY(EditAnywhere, meta=(Categories="Farm.Tools"))
FGameplayTag DefaultEquippedTool;
UPROPERTY(EditAnywhere, meta=(Categories="Dungeon.Item,Palace.Weapon"))
TArray<FGameplayTag> ShopInventory;
Files and Directories
UPROPERTY(meta=(
RelativePath
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
ContentDir
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
RelativeToGameContentDir
))
Shows an error if the user chooses a directory outside of the game's Content
directory.
UPROPERTY(meta=(
RelativeToGameDir
))
Note that this does not work with FDirectoryPath
.
UPROPERTY(meta=(
FilePathFilter
="abc"))
Position:
Meta
Type:
string
UPROPERTY(config, EditAnywhere, meta = (FilePathFilter = "uasset"))
FFilePath BlueprintAsset;
UPROPERTY(EditAnywhere, meta = (FilePathFilter = "Comma-separated value files (*.csv)|*.csv", RelativeToGameDir))
FFilePath CSVFilePath;
UPROPERTY(meta=(
ForceShowEngineContent
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
ForceShowPluginContent
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
HideViewOptions
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
LongPackageName
))
Position:
Meta
Type:
flag
Scripting
UPROPERTY(meta=(
ScriptNoExport
))
Position:
Meta
Type:
flag
Also used on UFUNCTION()
UPROPERTY(meta=(
ScriptName
="abc"))
Position:
Meta
Type:
string
Also used on UFUNCTION()
Config Files
UPROPERTY(
Config
)
Position:
Main
Type:
flag
UPROPERTY(
GlobalConfig
)
Position:
Main
Type:
flag
UPROPERTY(meta=(
ConfigHierarchyEditable
))
UPROPERTY(meta=(
ConfigRestartRequired
=true))
Used in config
-marked Project Settings and Editor Preferences variables. When variables marked with this are changed, Unreal prompts the user to restart their editor for the changes to take effect.
Asset Registry
UPROPERTY(meta=(
AllowedTypes
="abc"))
Position:
Meta
Type:
string (comma-separated list of classes)
Related:
The only time this is actually used is inside the Lyra Example Project but has existed in the engine prior to Unreal Engine 5.0.
To confirm that it exists within the engine you can look inside PrimaryAssetIdCustomization.cpp
and look for GetMetaData("AllowedTypes")
,
that file was added in 4.16(but the underlying code for it could have existed somewhere else in an earlier version).
For some reason this doesn't even show up in the ObjectMacros.h
file.
UCLASS(Blueprintable, BlueprintType)
class UFancyNamedDataAsset : public UPrimaryDataAsset
{
GENERATED_BODY()
public:
UFancyNamedDataAsset()
{
// This is the allowed type, which is the FPrimaryAssetType
AssetType = TEXT("FancyAssetName");
}
// UObject interface
virtual FPrimaryAssetId GetPrimaryAssetId() const override { return FPrimaryAssetId(AssetType, GetFName()); }
// ~UObject interface
/** The type of asset, in this example this value HAS to be specified in the constructor for each type(unless its abstract). */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category= "Primary Asset")
FPrimaryAssetType AssetType;
}
UPROPERTY(meta = (AllowedTypes = "FancyAssetName"))
FPrimaryAssetId FancyAsset;
/** Affects any primary asset ID's in the TMap */
UPROPERTY(meta = (AllowedTypes = "FancyAssetName"))
TMap<FGameplayTag, FPrimaryAssetId> FancyAssetMap;
UPROPERTY(
AssetRegistrySearchable
)
Position:
Main
Type:
flag
UPROPERTY(meta=(
Untracked
))
Position:
Meta
Type:
flag
Animation
UPROPERTY(
Interp
)
Position:
Main
Type:
flag
Makes a variable animate-able on timelines. Works for any kind of timeline, including in UMG. For a more detailed example check out this tutorial.
UPROPERTY(EditAnywhere, Interp)
float Radius;
UPROPERTY(meta=(
AlwaysAsPin
))
Position:
Meta
Type:
flag
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Settings, meta=(AlwaysAsPin))
EHand Hand = EHand::VR_LeftHand;
UPROPERTY(meta=(
NeverAsPin
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
PinShownByDefault
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
PinHiddenByDefault
))
Position:
Meta
Type:
flag
UPROPERTY(meta=(
CustomizeProperty
))
Position:
Meta
Type:
flag
Materials
UPROPERTY(meta=(
OverridingInputProperty
="abc"))
Position:
Meta
Type:
string (Another UPROPERTY)
UCLASS(MinimalAPI)
class UMaterialExpressionAdd : public UMaterialExpression
{
GENERATED_BODY()
UPROPERTY(meta = (RequiredInput = "false", ToolTip = "Defaults to 'ConstA' if not specified"))
FExpressionInput A;
// Only used if A is not hooked up
UPROPERTY(EditAnywhere, meta=(OverridingInputProperty="A"))
float ConstA;
};
UPROPERTY(meta=(
RequiredInput
=true))
Position:
Meta
Type:
bool
UCLASS(MinimalAPI, collapsecategories, hidecategories=Object)
class UMaterialExpressionFresnel : public UMaterialExpression
{
GENERATED_BODY()
UPROPERTY(meta = (RequiredInput = "false", ToolTip = "Defaults to 'BaseReflectFraction' if not specified"))
FExpressionInput BaseReflectFractionIn;
};
C++
UPROPERTY(
Export
)
Position:
Main
Type:
flag
UPROPERTY(
Native
)
Position:
Main
Type:
flag
UPROPERTY(
NoExport
)
Position:
Main
Type:
flag
UPROPERTY(meta=(
IgnoreForMemberInitializationTest
))
Position:
Meta
Type:
flag
Assets
UPROPERTY(meta=(
AssetBundles
="abc"))
UPROPERTY(meta=(
IncludeAssetBundles
="abc"))
Position:
Meta
Type:
string
Related:
Used to make properties marked with AssetBundles
be included with the outer object's AssetBundleData
UCLASS()
class UMyContainer : public UObject
{
GENERATED_BODY()
UPROPERTY(EditDefaultsOnly, meta=(AssetBundles="Client"))
TSoftClassPtr<UObject> Something;
}
UCLASS()
class UMyPrimaryAsset : public UPrimaryDataAsset
{
// Without meta=(IncludeAssetBundles), the properties within UMyContainer
// would not be added to this asset's AssetBundleData
UPROPERTY(EditDefaultsOnly, meta=(IncludeAssetBundles))
TSoftObjectPtr<UMyContainer> Container;
}
Todo
UPROPERTY(meta=(
XAxisName
="abc"))
Position:
Meta
Type:
string
Related:
Set the label on the X axis in curves.
UPROPERTY(EditAnywhere, Config, meta=(XAxisName="Distance", YAxisName="Value"))
FRuntimeFloatCurve DistanceCurve;
UPROPERTY(meta=(
YAxisName
="abc"))
Position:
Meta
Type:
string
Related:
Set the label on the Y axis in curves.
UPROPERTY(EditAnywhere, Config, meta=(XAxisName="Distance", YAxisName="Value"))
FRuntimeFloatCurve DistanceCurve;