UPROPERTY

UProperty variables are declared using standard C++ syntax with additional descriptors, such as variable specifiers and metadata placed above the declaration.

Updated 4 months ago Edit Page Revisions

Description

UPROPERTY variables are declared using standard C++ syntax with additional descriptors, such as variable specifiers and metadata placed above the declaration.

UPROPERTY([specifier,specifier,...],[meta=(key=value,key=value,...)])
TypeVariableName;

Aside from this comprehensive wiki article, the official documentation lists all valid property specifiers excluding the meta data specifiers below.

Garbage Collection

In a nutshell, Garbage Collection (GC) traverses the object hierarchy through designated UPROPERTYs, starting from the root objects (hence AddToRoot and RemoveFromRoot methods). Any object that cannot be reached through this traversal will be garbage collected. Accordingly, non-UPROPERTY variables are not counted by the GC system.

In other words, if you have two UObjects which reference each other (aka. Cyclic Reference), but no other objects refer to them, both of these UObjects will be GCed.

Valid Specifiers

You can use using namespace UP; to have these keywords as enums thus potentially have them auto-complete.
(Works with VAssistX)

Pro Tip: All valid UPROPERTY specifiers are listed as enum values in "ObjectMacros.h". Just search for namespace UP

  • Const

    This property is const and should be exported as const.

As of at least 4.12.5, using this as a UPROPERTY specifier will cause a compilation error. Use one of the Visible* specifiers instead.

  • Config

    Property should be loaded/saved to ini file as permanent profile.

  • GlobalConfig

    Same as above but load config from base class, not subclass.

  • Localized

    Property should be loaded as localizable text. Implies ReadOnly.

This specifier has been deprecated.

  • Transient

    Property is transient: shouldn't be saved, zero-filled at load time. Opposite of the SaveGame specifier.

  • DuplicateTransient

    Property should always be reset to the default value during any type of duplication (copy/paste, binary duplication, etc.)

  • NonPIETransient

    Property should always be reset to the default value during any type of duplication (copy/paste, binary duplication, etc.)

  • Ref

    Value is copied out after function call. Only valid on function param declaration.

  • Export

    Object property can be exported with it's owner.

  • EditInline

    Edit this object reference inline in the editor. {{warning}}

This specifier has been deprecated. You should use "Instanced" instead.

  • NoClear

    Hide clear (and browse) button in the editor.

  • EditFixedSize

    Indicates that elements of an array can be modified in Editor, but its size cannot be changed.

  • Replicated

    Property is relevant to network replication.

  • ReplicatedUsing

    Property will be configured for replication. The provided function is called only when the replicated property is received via replication.

  • RepRetry

    Retry replication of this property if it fails to be fully sent (e.g. object references not yet available to serialize over the network)

  • NotReplicated

    Skip replication (only for struct members and parameters in service request functions).

  • Interp

    Interpolatable property for use with matinee. Always user-settable in the editor.

  • NonTransactional

    Changes to this variable value will not be included in the editor's undo/redo history.

  • Instanced

    Property is a component reference. Implies EditInline and Export.

  • BlueprintAssignable

    MC Delegates only. Property should be exposed for assigning in blueprints.

  • Category

    Specifies the category of the property within the Editor. Supports sub-categories separated by "|".

  • SimpleDisplay

    Properties appear visible by default in a details panel

  • AdvancedDisplay

    Moves the property into the Advanced dropdown in the Details panel within the Editor.

If you add "AdvancedDisplay" to UPROPERTY(), you shouldn't set more than one level of Category, or this variable will be disappeared in Details. But these Categories still work in Blueprint Variables. {Category = "MyActor_UPROPERTY"} √, {Category = "MyActor_UPROPERTY|DisappearInDetails"} ×.

  • EditAnywhere

    Indicates that this property can be edited via property windows, archetypes and instances within the Editor.

  • EditInstanceOnly

    Indicates that this property can be edited by property windows, but only on instances, not on archetypes

  • EditDefaultsOnly

    Indicates that this property can be edited by property windows, but only on archetypes. This operator is incompatible with the Visible* specifiers.

  • VisibleAnywhere

    Indicates that this property is visible in property windows, but cannot be edited at all

  • VisibleInstanceOnly

    Indicates that this property is only visible in property windows for instances, not for archetypes, and cannot be edited

  • VisibleDefaultsOnly

    Indicates that this property is only visible in property windows for archetypes, and cannot be edited

  • BlueprintReadOnly

    This property can be read by blueprints, but not modified.

  • BlueprintReadWrite

    This property can be read or written from a blueprint.

  • AssetRegistrySearchable

    The AssetRegistrySearchable keyword indicates that this property and it's value will be automatically added to the asset registry for any asset class instances containing this as a member variable. It is not legal to use on struct properties or parameters.

  • SaveGame

    Property should be serialized for save game. Opposite of the Transient specifier.

  • BlueprintCallable

    Multicast Delegates only. Property should be exposed for calling in blueprint code

  • BlueprintAuthorityOnly

    MC Delegates only. This delegate accepts (only in blueprint) only events with BlueprintAuthorityOnly.

  • TextExportTransient

    Property shouldn't be exported to text format (e.g. copy/paste)

  • BindWidget

    Allows C++ code to access widgets of a Blueprint subclass at runtime. This meta specifier only works on subclasses of UWidget.

    Example usage:

    UPROPERTY(BlueprintReadWrite, meta = (BindWidget))
    UTextBlock* CoinLabel;
    

    Create a User Widget Blueprint subclass of your C++ widget and create a widget of the same name and type. You can now access and modify that widget from C++.

  • BindWidgetOptional

    If a bound widget with this meta specifier is not found in a User Widget Blueprint, only a log entry will be displayed instead of an error being thrown during compilation.

  • BindWidgetAnim

    Same concept as BindWidget, but for UWidgetAnimations.

  • BindWidgetAnimOptional

    Similar to BindWidgetOptional, no error will be thrown if no animation is found in the User Widget Blueprint.

Valid Meta Properties

  • DisplayName

    Sets the display name for the property in the editor. The default value is the variable name with a space before each capital letter beyond the first. For example MyVariableName would display as My Variable Name.

Boolean variables with names that start with a lowercase "b" and and followed by an uppercase letter will be culled by default within the Editor. But if you use "DisplayName", it won't be affected by this.

  • AllowAbstract

    Used for FStringClassReference properties. Indicates whether abstract class types should be shown in the class picker.

  • AllowedClasses

    Used for FStringAssetReference properties. Comma delimited list that indicates the class type(s) of assets to be displayed in the asset picker.

  • AllowPreserveRatio

    Used for FVector properties. It causes a ratio lock to be added when displaying this property in details panels.

  • ArrayClamp

    Used for integer properties. Clamps the valid values that can be entered in the Details to be between 0 and the maximum index of an array. However, if you change its value not in Details, it can exceed the limit value.

For example, you set a TArray property named "uproperty_Array", then set a int32 property and add "Meta = (ArrayClamp = "uproperty_Array")" to its UPROPERTY().

  • ClampMin

    Used for float and int properties. Specifies the minimum value that may be entered for the property.

  • ClampMax

    Used for float and int properties. Specifies the maximum value that may be entered for the property.

I found that "ClampMin" and "ClampMax" also can be used for TArray and TArray, but I didn't try it for other containers.

  • DisplayThumbnail

    Indicates that the property is an asset type and it should display the thumbnail of the selected asset.

  • EditCondition

    Specifies a boolean property that is used to indicate whether editing of this property is allowed within the editor.

  • ExactClass

    Used for FStringAssetReference properties in conjunction with AllowedClasses. Indicates whether only the exact classes specified in AllowedClasses can be used or whether subclasses are valid.

  • ExposeFunctionCategories

    From the official documentation: "Specifies a list of categories whose functions should be exposed when building a function list in the Blueprint Editor."

  • ExposeOnSpawn

    Specifies whether the property should be exposed on a Spawn Actor for the class type.

  • FixedIncrement

    From the official documentation: "Deprecated."

  • ForceRebuildProperty

    [Undocumented]

  • HideAlphaChannel

    Used for FColor and FLinearColor properties. Indicates that the Alpha property should be hidden when displaying the property widget in the details.

  • IsBlueprintBaseOnly

    Used for FStringClassReference properties. Indicates whether only blueprint classes should be shown in the class picker.

  • OnlyPlaceable

    Used for Subclass properties. Indicates whether only placeable classes should be shown in the class picker.

  • MakeEditWidget

    When used with certain objects such as an FVector, you get to use an "edit widget" within the editor to transform the object in space.

  • MakeStructureDefaultValue

    For properties in a structure indicates the default value of the property in a blueprint make structure node.

  • MetaClass

    Used FStringClassReference properties. Indicates the parent class that the class picker will use when filtering which classes to display.

  • Multiple

    From the official documentation: "Used for numeric properties. Stipulates that the value must be a multiple of the metadata value."

  • MultiLine

    Used for FString and FText properties. Indicates that the edit field should be multi-line, allowing entry of newlines.

    Usage: meta=(MultiLine=true)

  • NoElementDuplicate

    Used for array properties. Indicates that the duplicate icon should not be shown for entries of this array in the property panel.

  • NoSpinbox

    Used for float and int properties. Indicates that the spin box element of the number editing widget should not be displayed.

  • FilePathFilter

    Used by FFilePath properties. Indicates the path filter to display in the file picker.

  • RelativePath

    Used by FDirectoryPath properties.

  • RelativeToGameContentDir

    Used by FDirectoryPath properties.

  • ShowOnlyInnerProperties

    Used for struct properties. The properties of the struct are shown directly in the details panel instead of having the need to expand them to show them.

  • SliderExponent

    From the official documentation: "Used by numeric properties. Indicates how rapidly the value will grow when moving an unbounded slider."

  • UIMin

    Used for float and int properties. Specifies the lowest that the value slider should represent.

  • UIMax

    Used for float and int properties. Specifies the highest that the value slider should represent.

Deprecation

Native: Add the _DEPRECATED suffix to the end of the variable name.

Functions and Classes are deprecated using Meta tags rather than a suffix.

Blueprint: You may deprecate a Blueprint Property using a checkbox in its properties.

Related

Here is a great list of all UPROPERTY specifiers.

UCLASS, UFUNCTION, USTRUCT, UPARAM, UENUM, UDELEGATE