Function Specifiers

 UFUNCTION([specifier, specifier, ...], [meta(key=value, key=value, ...)])
 ReturnType FunctionName([Parameter, Parameter, ...])
BlueprintAuthorityOnly
This function will only execute from Blueprint code if running on a machine with network authority (a server, dedicated server, or single-player game).
BlueprintCallable
The function can be executed in a Blueprint or Level Blueprint graph.
BlueprintCosmetic
This function is cosmetic and will not run on dedicated servers.
BlueprintGetter
This function will be used as the accessor for a Blueprint-exposed property. This specifier implies BlueprintPure and BlueprintCallable.
BlueprintImplementableEvent
The function can be implemented in a Blueprint or Level Blueprint graph. C++中不可以给出定义
BlueprintInternalUseOnly
Indicates that the function should not be exposed to the end user.
BlueprintNativeEvent
This function is designed to be overridden by a Blueprint, but also has a default native implementation. Declares an additional function named the same as the main function, but with _Implementation added to the end, which is where code should be written. The autogenerated code will call the "_Implementation" method if no Blueprint override is found.
BlueprintPure
The function does not affect the owning object in any way and can be executed in a Blueprint or Level Blueprint graph.
BlueprintSetter
This function will be used as the mutator for a Blueprint-exposed property. This specifier implies BlueprintCallable.
CallInEditor
This function can be called in the Editor on selected instances via a button in the Details Panel.
Category = "TopCategory|SubCategory|Etc"
Specifies the category of the function when displayed in Blueprint editing tools. Define nested categories using the | operator.
Client
The function is only executed on the client that owns the Object on which the function is called. Declares an additional function named the same as the main function, but with _Implementation added to the end. The autogenerated code will call the "_Implementation" method when necessary.
CustomThunk
The UnrealHeaderTool code generator will not produce a thunk for this function; it is up to the user to provide one.
Exec
The function can be executed from the in-game console. Exec commands only function when declared within certain classes.
NetMulticast
The function is executed both locally on the server, and replicated to all clients, regardless of the Actor's NetOwner.
Reliable
The function is replicated over the network, and is guaranteed to arrive regardless of bandwidth or network errors. Only valid when used in conjunction with Client or Server.
SealedEvent
This function cannot be overridden in subclasses. The SealedEvent keyword can only be used for events. For non-event functions, declare them as static or final to seal them.
ServiceRequest
This function is an RPC (Remote Procedure Call) service request.
ServiceResponse
This function is an RPC service response.
Server
The function is only executed on the server. Declares an additional function named the same as the main function, but with _Implementation added to the end, which is where code should be written. The autogenerated code will call the "_Implementation" method when necessary.
Unreliable
The function is replicated over the network but can fail due to bandwidth limitations or network errors. Only valid when used in conjunction with Client or Server.
WithValidation
Declares an additional function named the same as the main function, but with _Validate added to the end. This function takes the same parameters, and returns a bool to indicate whether or not the call to the main function should proceed.
Out
Declares the parameter as being passed by reference allowing it to be modified by the function.
Optional
With the optional keyword, you can make certain function parameters optional, as a convenience to the caller. The values for optional parameters which the caller does not specify depend on the function. For example, the SpawnActor function takes an optional location and rotation, which default to the location and rotation of the spawning Actor's root component. The default value of optional arguments can be specified by adding = [value]. For example: function myFunc(optional int x = -1). In most cases, the default value for the type of variable, or zero (e.g. 0, false, "", none), is used when no values is passed to an optional parameter.
Out应该是与UPARAM(ref)等效的

AdvancedDisplay="Parameter1, Parameter2, .."
The comma-separated list of parameters will show up as advanced pins (requiring UI expansion).
AdvancedDisplay=N
Replace N with a number, and all parameters after the Nth will show up as advanced pins (requiring UI expansion). E.g. 'AdvancedDisplay=2' will mark all but the first two parameters as advanced).
ArrayParm="Parameter1, Parameter2, .."
Indicates that a BlueprintCallable function should use a Call Array Function node and that the listed parameters should be treated as wild card array properties.
ArrayTypeDependentParams="Parameter"
When ArrayParm is used, this specifier indicates one parameter which will determine the types of all parameters in the ArrayParm list.
AutoCreateRefTerm="Parameter1, Parameter2, .."
The listed parameters, although passed by reference, will have an automatically-created default if their pins are left disconnected. This is a convenience feature for Blueprints.
BlueprintAutocast
Used only by static BlueprintPure functions from a Blueprint Function Library. A Cast node will be automatically added for the return type and the type of the first parameter of the function.
BlueprintInternalUseOnly
This function is an internal implementation detail, used to implement another function or node. It is never directly exposed in a Blueprint Graph.
BlueprintProtected
This function can only be called on the owning Object in a Blueprint. It cannot be called on another instance.
CallableWithoutWorldContext
Used for BlueprintCallable functions that have a WorldContext pin to indicate that the function can be called even if its class does not implement the GetWorld function.
CommutativeAssociativeBinaryOperator
Indicates that a BlueprintCallable function should use the Commutative Associative Binary node. This node lacks pin names, but features an "Add Pin" button that creates additional input pins.
CompactNodeTitle="Name"
Indicates that a BlueprintCallable function should display in the compact display mode, and provides the name to display in that mode.
CustomStructureParam="Parameter1, Parameter2, .."
The listed parameters are all treated as wildcards. This specifier requires the UFUNCTION-level specifier, CustomThunk, which will require the user to provide a custom exec function. In this function, the parameter types can be checked and the appropriate function calls can be made based on those parameter types. The base UFUNCTION should never be called, and should assert or log an error if it is.
To declare a custom exec function, use the syntax DECLARE_FUNCTION(execMyFunctionName) where MyFunctionName is the name of the original function.
DefaultToSelf
For BlueprintCallable functions, this indicates that the Object property's named default value should be the self context of the node.
DeprecatedFunction
Any Blueprint references to this function will cause compilation warnings telling the user that the function is deprecated. You can add to the deprecation warning message (e.g. to provide instructions on replacing the deprecated function) using the DeprecationMessage metadata specifier.
DeprecationMessage="Message Text"
If the function is deprecated, this message will be added to the standard deprecation warning when trying to compile a Blueprint that uses it.
DevelopmentOnly
Functions marked as DevelopmentOnly will only run in Development mode. This is useful for functionality like debug output, which is expected not to exist in shipped products.
DisplayName="Blueprint Node Name"
The name of this node in a Blueprint will be replaced with the value provided here, instead of the code-generated name.
ExpandEnumAsExecs="Parameter"
For BlueprintCallable functions, this indicates that one input execution pin should be created for each entry in the enum used by the parameter. That the named parameter must be of an enumerated type recognized by the Engine via the UENUM tag.
HidePin="Parameter"
For BlueprintCallable functions, this indicates that the parameter pin should be hidden from the user's view. Note that only one parameter pin per function can be hidden in this manner.
HideSelfPin
Hides the "self" pin, which is used to indicate the object on which the function is being called. The "self" pin is automatically hidden on BlueprintPure functions that are compatible with the calling Blueprint's class. This is generally used with the DefaultToSelf specifier.
InternalUseParam="Parameter"
Similar to HidePin, this hides the named parameter's pin from the user's view, and can only be used for one parameter per function.
KeyWords="Set Of Keywords"
Specifies a set of keywords that can be used when searching for this function, such as when placing a node to call the function in a Blueprint Graph.
Latent
Indicates a latent action. Latent actions have one parameter of type FLatentActionInfo, and this parameter is named by the LatentInfo specifier.
LatentInfo="Parameter"
For Latent BlueprintCallable functions indicates which parameter is the LatentInfo parameter.
MaterialParameterCollectionFunction
For BlueprintCallable functions, indicates that the material override node should be used.
NativeBreakFunc
For BlueprintCallable functions, indicates that the function should be displayed the same way as a standard Break Struct node.
NotBlueprintThreadSafe
Only valid in Blueprint Function Libraries. This function will be treated as an exception to the owning class's general BlueprintThreadSafe metadata.
ShortToolTip="Short tooltip"
A short tooltip that is used in some contexts where the full tooltip might be overwhelming, such as the parent class picker dialog.
ToolTip="Hand-written tooltip
Overrides the automatically generated tooltip from code comments.
UnsafeDuringActorConstruction
This function is not safe to call during Actor construction.
WorldContext="Parameter"
Used by BlueprintCallable functions to indicate which parameter determines the World that the operation is occurring within.

UFUNCTION输入输出参数

Blueprint functions with "multiple" return values are actually just C++ reference parametres to determine what the return values are.
For instance:
Code:
 UFUNCTION( Category=Foo, BlueprintCallable )
 void Foo( const FBar& Bar );
Since the reference is const and the function therefore cannot modify it, Blueprint will treat it as an "in" param. Conversely:
Code:
 UFUNCTION( Category=Foo, BlueprintCallable )
 void Foo( FBar& Bar );
Since the reference is not const, you can modify it in the function, so Blueprint assumes that is the intent and treats it as "out". Continuing from there, you can have multiple non-const reference params:
Code:
 UFUNCTION( Category=Foo, BlueprintCallable )
 void Foo( FBar& Bar, FVector& Baz, FRotator& Qux );
All of these mutable params will be treated as "out" by Blueprint, resulting in multiple "return" values. This is how engine functions do it.
直接指定输入参数为引用模式:
 UFUNCTION(BlueprintCallable, meta=(DisplayName="Invalidate_Guid (Guid)"), Category="Guid")
 static void Invalidate_Guid( UPARAM(ref) FGuid& InGuid );

Property Specifiers → ...


  • Property Tag
AdvancedDisplay
The property will be placed in the advanced (dropdown) section of any panel where it appears.
AssetRegistrySearchable
The AssetRegistrySearchable Specifier indicates that this property and its 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.
BlueprintAssignable
Usable with Multicast Delegates only. Exposes the property for assigning in Blueprints.
BlueprintAuthorityOnly
This property must be a Multicast Delegate. In Blueprints, it will only accept events tagged with BlueprintAuthorityOnly.
BlueprintCallable
Multicast Delegates only. Property should be exposed for calling in Blueprint code.
BlueprintGetter=GetterFunctionName
This property specifies a custom accessor function. If this property isn't also tagged with BlueprintSetter or BlueprintReadWrite, then it is implicitly BlueprintReadOnly.
BlueprintReadOnly
This property can be read by Blueprints, but not modified. This Specifier is incompatible with the BlueprintReadWrite Specifier.
BlueprintReadWrite
This property can be read or written from a Blueprint. This Specifier is incompatible with the BlueprintReadOnly Specifier.
BlueprintSetter=SetterFunctionName
This property has a custom mutator function, and is implicitly tagged with BlueprintReadWrite. Note that the mutator function must be named and part of the same class.
Category="TopCategory|SubCategory|..."
Specifies the category of the property when displayed in Blueprint editing tools. Define nested categories using the | operator.
Config
This property will be made configurable. The current value can be saved to the .ini file associated with the class and will be loaded when created. Cannot be given a value in default properties. Implies BlueprintReadOnly.
DuplicateTransient
Indicates that the property's value should be reset to the class default value during any type of duplication (copy/paste, binary duplication, etc.).
EditAnywhere
Indicates that this property can be edited by property windows, on archetypes and instances. This Specifier is incompatible with any of the the "Visible" Specifiers.
EditDefaultsOnly
Indicates that this property can be edited by property windows, but only on archetypes. This Specifier is incompatible with any of the "Visible" Specifiers.
EditFixedSize
Only useful for dynamic arrays. This will prevent the user from changing the length of an array via the Unreal Editor property window.
EditInline
Allows the user to edit the properties of the Object referenced by this property within Unreal Editor's property inspector (only useful for Object references, including arrays of Object reference).
EditInstanceOnly
Indicates that this property can be edited by property windows, but only on instances, not on archetypes. This Specifier is incompatible with any of the "Visible" Specifiers.
Export
Only useful for Object properties (or arrays of Objects). Indicates that the Object assigned to this property should be exported in its entirety as a subobject block when the Object is copied (such as for copy/paste operations), as opposed to just outputting the Object reference itself.
GlobalConfig
Works just like Config except that you cannot override it in a subclass. Cannot be given a value in default properties. Implies BlueprintReadOnly.
Instanced
Object (UCLASS) properties only. When an instance of this class is created, it will be given a unique copy of the Object assigned to this property in defaults. Used for instancing subobjects defined in class default properties. Implies EditInline and Export.
Interp
Indicates that the value can be driven over time by a Track in Matinee.
Localized
The value of this property will have a localized value defined. Mostly used for strings. Implies ReadOnly.
Native
Property is native: C++ code is responsible for serializing it and exposing to Garbage Collection .
NoClear
Prevents this Object reference from being set to none from the editor. Hides clear (and browse) button in the editor.
NoExport
Only useful for native classes. This property should not be included in the auto-generated class declaration.
NonPIEDuplicateTransient
The property will be reset to the default value during duplication, except if it's being duplicated for a Play In Editor (PIE) session.
NonTransactional
Indicates that changes to this property's value will not be included in the editor's undo/redo history.
NotReplicated
Skip replication. This only applies to struct members and parameters in service request functions.
Replicated
The property should be replicated over the network.
ReplicatedUsing=FunctionName
The ReplicatedUsing Specifier specifies a callback function which is executed when the property is updated over the network.
RepRetry
Only useful for struct properties. Retry replication of this property if it fails to be fully sent (for example, Object references not yet available to serialize over the network). For simple references, this is the default, but for structs, this is often undesirable due to the bandwidth cost, so it is disabled unless this flag is specified.
SaveGame
This Specifier is a simple way to include fields explicitly for a checkpoint/save system at the property level. The flag should be set on all fields that are intended to be part of a saved game, and then a proxy archiver can be used to read/write it.
SerializeText
Native property should be serialized as text (ImportText, ExportText).
SkipSerialization
This property will not be serialized, but can still be exported to a text format (such as for copy/paste operations).
SimpleDisplay
Visible or editable properties appear in the Details panel and are visible without opening the "Advanced" section.
TextExportTransient
This property will not be exported to a text format (so it cannot, for example, be used in copy/paste operations).
Transient
Property is transient, meaning it will not be saved or loaded. Properties tagged this way will be zero-filled at load time.
VisibleAnywhere
Indicates that this property is visible in all property windows, but cannot be edited. This Specifier is incompatible with the "Edit" Specifiers.
VisibleDefaultsOnly
Indicates that this property is only visible in property windows for archetypes, and cannot be edited. This Specifier is incompatible with any of the "Edit" Specifiers.
VisibleInstanceOnly
Indicates that this property is only visible in property windows for instances, not for archetypes, and cannot be edited. This Specifier is incompatible with any of the "Edit" Specifiers.

When declaring classes, interfaces, structs, enums, enum values, functions, or properties, you can add Metadata Specifiers to control how they interact with various aspects of the engine and editor. Each type of data structure or member has its own list of Metadata Specifiers.
Metadata only exists in the editor; do not write game logic that accesses metadata.
AllowAbstract="true/false"
Used for Subclass and SoftClass properties. Indicates whether abstract Class types should be shown in the Class picker.
AllowedClasses="Class1, Class2, .."
Used for FSoftObjectPath 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="ArrayProperty"
Used for integer properties. Clamps the valid values that can be entered in the UI to be between 0 and the length of the array property named.
AssetBundles
Used for SoftObjectPtr or SoftObjectPath properties. List of Bundle names used inside Primary Data Assets to specify which Bundles this reference is part of.
BlueprintBaseOnly
Used for Subclass and SoftClass properties. Indicates whether only Blueprint Classes should be shown in the Class picker.
BlueprintCompilerGeneratedDefaults
Property defaults are generated by the Blueprint compiler and will not be copied when the CopyPropertiesForUnrelatedObjects function is called post-compile.
ClampMin="N"
Used for float and integer properties. Specifies the minimum value N that may be entered for the property.
ClampMax="N"
Used for float and integer properties. Specifies the maximum value N that may be entered for the property.
ConfigHierarchyEditable
This property is serialized to a config (.ini) file, and can be set anywhere in the config hierarchy.
ContentDir
Used by FDirectoryPath properties. Indicates that the path will be picked using the Slate-style directory picker inside the Content folder.
DisplayAfter="PropertyName"
This property will show up in the Blueprint Editor immediately after the property named PropertyName, regardless of its order in source code, as long as both properties are in the same category. If multiple properties have the same DisplayAfter value and the same DisplayPriority value, they will appear after the named property in the order in which they are declared in the header file.
DisplayName="Property Name"
The name to display for this property, instead of the code-generated name.
DisplayPriority="N"
If two properties feature the same DisplayAfter value, or are in the same category and do not have the DisplayAfter Meta Tag, this property will determine their sorting order. The highest-priority value is 1, meaning that a property with a DisplayPriority value of 1 will appear above a property with a DisplayProirity value of 2. If multiple properties have the same DisplayAfter value, they will appear in the order in which they are declared in the header file.
DisplayThumbnail="true"
Indicates that the property is an Asset type and it should display the thumbnail of the selected Asset.
EditCondition="BooleanPropertyName"
Names a boolean property that is used to indicate whether editing of this property is disabled. Putting "!" before the property name inverts the test.
The EditCondition meta tag is no longer limited to a single boolean property. It is now evaluated using a full-fledged expression parser, meaning you can include a full C++ expression.
EditFixedOrder
Keeps the elements of an array from being reordered by dragging.
ExactClass="true"
Used for FSoftObjectPath properties in conjunction with AllowedClasses. Indicates whether only the exact Classes specified in AllowedClasses can be used, or if subclasses are also valid.
ExposeFunctionCategories="Category1, Category2, .."
Specifies a list of categories whose functions should be exposed when building a function list in the Blueprint Editor.
ExposeOnSpawn="true"
Specifies whether the property should be exposed on a Spawn Actor node for this Class type.
FilePathFilter="FileType"
Used by FFilePath properties. Indicates the path filter to display in the file picker. Common values include "uasset" and "umap", but these are not the only possible values.
GetByRef
Makes the "Get" Blueprint Node for this property return a const reference to the property instead of a copy of its value. Only usable with Sparse Class Data, and only when NoGetter is not present.
HideAlphaChannel
Used for FColor and FLinearColor properties. Indicates that the Alpha property should be hidden when displaying the property widget in the details.
HideViewOptions
Used for Subclass and SoftClass properties. Hides the ability to change view options in the Class picker.
InlineEditConditionToggle
Signifies that the boolean property is only displayed inline as an edit condition toggle in other properties, and should not be shown on its own row.
LongPackageName
Used by FDirectoryPath properties. Converts the path to a long package name.
MakeEditWidget
Used for Transform or Rotator properties, or Arrays of Transforms or Rotators. Indicates that the property should be exposed in the viewport as a movable widget.
NoGetter
Causes Blueprint generation not to generate a "get" Node for this property. Only usable with Sparse Class Data.