Note: This page is still a work in progress. There are a lot of meta specifiers still to document!
Unreal's UFUNCTION 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 UFUNCTION
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.
Blueprint Logic
UFUNCTION(
BlueprintCallable
)
Position:
Main
Type:
flag
UFUNCTION(
BlueprintImplementableEvent
)
Position:
Main
Type:
flag
UFUNCTION(
BlueprintNativeEvent
)
Position:
Main
Type:
flag
UFUNCTION(meta=(
ForceAsFunction
))
Allows users to change a BlueprintImplementableEvent with no return value from an event into a function.
UFUNCTION(
BlueprintPure
)
Position:
Main
Type:
flag (Technically a flag but can be used with false to disable)
A BlueprintPure
function is shown as a node with no execution pin. By
default functions marked const
will be exposed as pure functions. To make a const function not a pure function, use BlueprintPure=false
.
Pure functions do not cache their results, so be careful when doing any non-trivial amount of work a blueprint pure function. It is good practice to avoid outputting array properties in blueprint pure functions.
UFUNCTION(BlueprintPure)
int32 BlueprintPureFunction();
UFUNCTION(BlueprintCallable)
int32 BlueprintCallableFunction();
UFUNCTION(BlueprintCallable)
int32 BlueprintCallableConstFunction() const;
UFUNCTION(BlueprintPure=false)
int32 BlueprintPureFalseFunction() const;
UFUNCTION(meta=(
ArrayParm
="abc"))
Position:
Meta
Type:
string
Related:
This only seems to be used in KismetArrayLibrary.h
where it's used with CustomThunk
-marked functions.
Note that this is "ArrayParm" and not "ArrayParam".
UFUNCTION(meta=(
ArrayTypeDependentParams
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
AutoCreateRefTerm
="abc"))
Position:
Meta
Type:
string (Comma-separated list)
Without AutoCreateRefTerm
, a reference paramter requires that the user provide it with a value, which can be annoying for parameters that have a sensible default.
When a blueprint is compiled where those parameters are not supplied with a value, an error like this will be shown "The current value of the 'Color' pin is invalid: 'Color' in action 'Some Color Without Ref' must have an input wired into it ("by ref" params expect a valid input to operate on)."
Note that it's possible to set multiple ref parameters by using a comma-separated list.
UFUNCTION(BlueprintCallable)
void SomeColorWithoutRef(const FLinearColor& Color) {}
UFUNCTION(BlueprintCallable, meta=(AutoCreateRefTerm="Color"))
void SomeColorWithRef(const FLinearColor& Color) {}
UFUNCTION(meta=(
BlueprintAutocast
))
Position:
Meta
Type:
flag
In Blueprints when you a drag a connection from pin of one type to another, Unreal can automatically cast from the incoming type to the other. BlueprintAutocast
is the way to make your own Blueprint helper functions to do that cast action.
BlueprintAutocast
requires the function to be static, public, BlueprintPure
, have at least 1 input, and have a return output. Only the first input will be considered for auto conversion, but you can have multiple.
public:
UFUNCTION(BlueprintPure, meta=(BlueprintAutocast))
static EAnimal IntToAnimal(int32 Input);
UFUNCTION(meta=(
BlueprintInternalUseOnly
=true))
Position:
Meta
Type:
bool
UFUNCTION(meta=(
BlueprintProtected
))
Position:
Meta
Type:
flag
UFUNCTION(meta=(
CallableWithoutWorldContext
))
Position:
Meta
Type:
flag
UFUNCTION(meta=(
CommutativeAssociativeBinaryOperator
))
Position:
Meta
Type:
flag
UFUNCTION(
SealedEvent
)
Position:
Main
Type:
flag
UFUNCTION(meta=(
CustomStructureParam
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
DefaultToSelf
))
Position:
Meta
Type:
flag
UFUNCTION(meta=(
DeprecatedFunction
))
Position:
Meta
Type:
flag
Related:
UFUNCTION(meta=(
DeprecationMessage
="abc"))
Position:
Meta
Type:
string
Related:
UFUNCTION(meta=(
DeterminesOutputType
="abc"))
Position:
Meta
Type:
string
Related:
UFUNCTION(BlueprintCallable, Category="Utilities", meta=(WorldContext="WorldContextObject", DeterminesOutputType="ActorClass", DynamicOutputParam="OutActors"))
static void GetAllActorsOfClass(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, TArray<AActor*>& OutActors);
UFUNCTION(meta=(
ExpandEnumAsExecs
="abc"))
Position:
Meta
Type:
string (name of enum parameter)
UENUM()
enum class EAnimalType : uint8
{
Cat,
Dog,
Rooster
};
UFUNCTION(BlueprintCallable, meta=(ExpandEnumAsExecs="Animal"))
static void SwitchAnimalByName(FString Name, EAnimalType& Animal);
UFUNCTION(meta=(
ExpandBoolAsExecs
="abc"))
Position:
Meta
Type:
string (name of bool parameter)
Note that "ReturnValue" is a special string used to refer to the return value of the function.
UFUNCTION(BlueprintCallable, meta=(ExpandBoolAsExecs="ReturnValue"))
static bool IsAboveFreezing(float Temperature);
UFUNCTION(BlueprintCallable, meta=(ExpandBoolAsExecs="bFreezing"))
static void IsAboveFreezing(float Temperature, bool& bFreezing);
UFUNCTION(meta=(
DynamicOutputParam
="abc"))
Position:
Meta
Type:
string (Parameter name)
Related:
UFUNCTION(BlueprintCallable, Category="Utilities", meta=(WorldContext="WorldContextObject", DeterminesOutputType="ActorClass", DynamicOutputParam="OutActors"))
static void GetAllActorsOfClass(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, TArray<AActor*>& OutActors);
UFUNCTION(meta=(
AllowPrivateAccess
=true))
Position:
Meta
Type:
bool
UFUNCTION(meta=(
(ParameterName=DefaultValue)
="abc"))
Position:
Meta
Type:
string
Not sure how to describe this one. Technically it doesn't have a name. Use it to give a parameter a default value, and override any existing C++ default value. See the examples and screenshots for how it affects what is displayed in-editor.
UFUNCTION(BlueprintCallable, meta=(Number="99"))
void DefaultParamInMeta(int32 Number);
UFUNCTION(BlueprintCallable)
void DefaultParamInCPP(int32 Number = 99);
UFUNCTION(BlueprintCallable, meta=(Number="1"))
void DefaultParamInBoth(int32 Number = 99);
UFUNCTION(BlueprintCallable, meta=(ComponentClass="ActorComponent"))
void DefaultTSubclassValue(TSubclassOf<UActorComponent> ComponentClass);
UFUNCTION(BlueprintCallable, meta=(RectColor="(R=0,G=1,B=0,A=1)"))
void DefaultStructValue(FLinearColor RectColor);
Editor
UFUNCTION(
CallInEditor
)
Position:
Main
Type:
flag
Causes a UFUNCTION
with no parameters and no return value to be shown in the details panel of object instances.
Could be useful for adding helper functions to change the values on the selected instance. For example increasing the level of an enemy by changing their stats, or filling out default values using C++.
To reiterate, only works with functions that have no parameters, and return void
. BlueprintCallable
is not required. Only works on instances of the class. So Actors placed in a level or data assets, not on Blueprint classes.
This works as a flag in the main position, or as a boolean in the meta position. I would stick to the Main position just because there are more examples of this in the Unreal codebase.
UFUNCTION(Category="Helper Functions", CallInEditor)
void AutofillData();
UFUNCTION(Category="Helper Functions", CallInEditor)
void ReticulateSplines();
UFUNCTION(Category="Helper Functions", CallInEditor)
void IncreaseLevel();
// This works
UFUNCTION(CallInEditor)
void MainPosition();
// This also works, but I wouldn't use it
UFUNCTION(meta=(CallInEditor=true))
void MetaPosition();
C++
UFUNCTION(
CustomThunk
)
Position:
Main
Type:
flag
I'm still not very familiar with this but check out KismetArrayLibrary.h
for an implementation that uses it.
Console
UFUNCTION(
Exec
)
Position:
Main
Type:
flag
Unreal has an in-game cheat console, accessed with the tilde key by default. It's great for adding debug commands and cheats. Any UFUNCTION
marked with Exec
can be executed there and provided with parameters.
The classes that are supported by Exec
by default are:
UWorld
UPlayerInput
UGameInstance
APlayerController
APawn
AHUD
AGameModeBase
ACheatManager
AGameStateBase
APlayerCameraManager
Appearance
UFUNCTION(meta=(
AdvancedDisplay
)
Position:
Meta
Type:
string or integer
UFUNCTION(meta=(
CompactNodeTitle
="abc"))
Position:
Meta
Type:
string
UFUNCTION(BlueprintPure)
FString WithoutCompactTitle(bool InBool);
UFUNCTION(BlueprintPure, meta=(CompactNodeTitle = ":)"))
FString WithCompactTitle(bool InBool);
UFUNCTION(meta=(
DisplayName
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
ReturnDisplayName
="abc"))
Position:
Meta
Type:
string
Change the label on the return value from the default "Return Value" to the specified string.
It's also possible to achieve the same thing by adding a UPARAM()
outside of the main UFUNCTION()
specifier. See the second example for how to do it.
UFUNCTION(BlueprintCallable, Category = "Doggy Daycare", meta=(ReturnDisplayName = "Success"))
bool TryPetDog(const FName Name);
// Does the same thing but looks gross
UFUNCTION(BlueprintCallable, Category = "Doggy Daycare")
UPARAM(meta=(DisplayName="Success"))
bool TryPetDog(const FName Name);
UFUNCTION(meta=(
HidePin
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
HideSelfPin
)
Position:
Meta
Type:
UFUNCTION(meta=(
ShortToolTip
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
ToolTip
="abc"))
Position:
Meta
Type:
string
Debug
UFUNCTION(meta=(
DevelopmentOnly
))
Position:
Meta
Type:
flag
UFUNCTION(meta=(
InternalUseParam
="abc"))
Position:
Meta
Type:
string
UFUNCTION(meta=(
KeyWords
="abc"))
Position:
Meta
Type:
string (space-separated list)
General
UFUNCTION(meta=(
Latent
)
Position:
Meta
Type:
Related:
UFUNCTION(meta=(
LatentInfo
="abc"))
Position:
Meta
Type:
string
Related:
UFUNCTION(meta=(
NativeBreakFunc
)
Position:
Meta
Type:
UFUNCTION(meta=(
NotBlueprintThreadSafe
)
Position:
Meta
Type:
UFUNCTION(meta=(
UnsafeDuringActorConstruction
)
Position:
Meta
Type:
UFUNCTION(meta=(
WorldContext
="abc"))
Position:
Meta
Type:
string
Materials
UFUNCTION(meta=(
MaterialParameterCollectionFunction
)
Position:
Meta
Type:
Network
UFUNCTION(
Server
UFUNCTION(
Client
)
UFUNCTION(
NetMulticast
Position:
Main
Type:
UFUNCTION(
BlueprintAuthorityOnly
)
Position:
Main
Type:
flag
UFUNCTION(
WithValidation
Position:
Main
Type:
UFUNCTION(
BlueprintCosmetic
)
Position:
Main
Type:
flag
UFUNCTION(
Reliable
UFUNCTION(
ServiceRequest
Position:
Main
Type:
Related:
UFUNCTION(
ServiceResponse
Position:
Main
Type:
Related:
Data Tables
UFUNCTION(meta=(
DataTablePin
="abc"))
Position:
Meta
Type:
string
Blueprint
UFUNCTION(meta=(
SetParam
="abc"))
Position:
Meta
Type:
string (Groups are separated by commas, params are separated by pipe.)
Requires:
Related:
Using SetParam
allows you to make "templated" Blueprint functions for Set containers that work for any datatype. It requires a CustomThunk
-generated function definition for it to work. For an example check BlueprintSetLibrary
.
In the Blueprint function declaration you write int32
but with these metadata specifiers and CustomThunk you can make it work for any datatype.
// An arbitrary function that takes a set of any type and does something with it
UFUNCTION(BlueprintCallable, CustomThunk, meta=(SetParam="SetToCheck|Value"))
static void CheckSet(const TSet<int32>& SetToCheck, int32 Value);
UFUNCTION(meta=(
MapParam
="abc"))
Position:
Meta
Type:
string (Groups are separated by commas, params are separated by pipe.)
Requires:
Related:
Using MapParam
allows you to make "templated" Blueprint functions for Map containers that work for any datatype. It requires a CustomThunk
-generated function definition for it to work. For an example check BlueprintMapLibrary
.
To add other parameters that match the types of the key and value of the Map, check MapKeyParam
and MapValueParam
.
In the Blueprint function declaration you write int32
but with these metadata specifiers and CustomThunk you can make it work for any datatype.
// An arbitrary function that takes a map of any type and does something with it
UFUNCTION(BlueprintCallable, CustomThunk, meta=(MapParam="SomeMap"))
static void CheckMap(TMap<int32, int32>& SomeMap);
UFUNCTION(meta=(
MapKeyParam
="abc"))
Position:
Meta
Type:
string (Groups are separated by commas, params are separated by pipe.)
Requires:
Related:
Allows you to specify a parameter which must match the type of the Key in the matching MapParam
. Can be used with MapValueParam
to add parameters that must match both Key and Value types.
If your function needs multiple TMap
inputs, I think it's possible to specify which one the MapParam
corresponds to by using commas to make groups.
In the Blueprint function declaration you write int32
but with these metadata specifiers and CustomThunk you can make it work for any datatype.
UFUNCTION(BlueprintCallable, CustomThunk, meta=(MapParam="MapToCheck", MapKeyParam="KeyBlah"))
static void CheckMap(TMap<int32, int32>& MapToCheck, const int32& KeyBlah);
UFUNCTION(meta=(
MapValueParam
="abc"))
Position:
Meta
Type:
string (Groups are separated by commas, params are separated by pipe.)
Requires:
Related:
Allows you to specify a parameter which must match the type of the Value in the matching MapParam
. Can be used with MapKeyParam
to add parameters that must match both Key and Value types.
If your function needs multiple TMap
inputs, I think it's possible to specify which one the MapParam
corresponds to by using commas to make groups.
In the Blueprint function declaration you write int32
but with these metadata specifiers and CustomThunk you can make it work for any datatype.
UFUNCTION(BlueprintCallable, CustomThunk, meta=(MapParam="MapToCheck", MapValueParam="ValueBlah"))
static void CheckMap(TMap<int32, int32>& MapToCheck, const int32& ValueBlah);