Note: This page is still a work in progress. There are a lot of meta specifiers still to document!
Unreal's Class Specifiers and Class Metadata Specifiers pages list 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 UCLASS
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.
Display
UCLASS(
AdvancedClassDisplay
)
Position:
Main
Type:
flag
Related:
UCLASS(
ClassGroup
="abc")
Position:
Main
Type:
string
Class Group must be something already registered, you can't put arbitrary strings in here.
Seems to be only used for the Add Component button within an actor.
UCLASS(ClassGroup="Animation")
class UMyActorComponent : public UActorComponent
{
GENERATED_BODY()
};
UCLASS(
AutoCollapseCategories
="abc")
Position:
Main
Type:
string (Space-separated list)
Incompatible with:
Opposite:
UCLASS(
DontAutoCollapseCategories
="abc")
UCLASS(
AutoExpandCategories
="abc")
UCLASS(
CollapseCategories
)
UCLASS(
DontCollapseCategories
)
UCLASS(meta=(
IgnoreCategoryKeywordsInSubclasses
))
Position:
Meta
Type:
flag
Related:
A child that subclasses a class with this meta tag will ignore the following specifiers in the parent: ShowCategories
, HideCategories
, AutoExpandCategories
, AutoCollapseCategories
and PrioritizeCategories
.
Only used in one place in the codebase. ComponentWrapperClass
is an odd alias for it.
UCLASS(meta=(
ToolTip
="abc"))
Position:
Meta
Type:
string
Related:
TODO Look into how this is different to ShortToolTip
UCLASS(meta=(
ShortToolTip
="abc"))
Position:
Meta
Type:
string
Related:
TODO Look into how this is different to ToolTip
UCLASS(meta=(ShortTooltip="A layout panel for automatically laying child widgets out vertically"))
class UMG_API UVerticalBox : public UPanelWidget
UCLASS(meta=(
PrioritizeCategories
="abc"))
Position:
Meta
Type:
string (Space-separated category names)
Related:
Only seems to be used in one place in the source, UCommonTextBlock
. Seems to cause the specified categories to be shown first.
Note that the category names are space separated, not comma-separated.
UCLASS(Config = CommonUI, DefaultConfig, ClassGroup = UI, meta = (Category = "Common UI", DisplayName = "Common Text", PrioritizeCategories = "Content"))
class COMMONUI_API UCommonTextBlock : public UTextBlock
UCLASS(meta=(
DeprecatedNode
))
Position:
Meta
Type:
flag
UCLASS(meta=(
DeprecationMessage
="abc"))
Position:
Meta
Type:
string
UCLASS(meta=(
DisplayName
="abc"))
Position:
Meta
Type:
string
Blueprint
UCLASS(
Abstract
)
Position:
Main
Type:
flag
// I am abstract, you can't instantiate me!
UCLASS(Abstract)
class UAnimalBase : public UObject
{
GENERATED_BODY()
public:
UAnimalBase(const FObjectInitializer& ObjectInitializer);
};
UCLASS(
Blueprintable
)
UCLASS(
NotBlueprintable
)
UCLASS(meta=(
IsBlueprintBase
=true))
Position:
Meta
Type:
bool
Related:
Is much less frequently used than Blueprintable
and NotBlueprintable
. I would stick to those.
UCLASS(
BlueprintType
)
UCLASS(BlueprintType)
class UExampleObject : public UObject
UCLASS(
NotBlueprintType
)
UCLASS(NotBlueprintType)
class UExampleObject : public UObject
UCLASS(
Const
)
Position:
Main
Type:
flag
Related:
Not entirely sure what difference this makes or when to use it.
UCLASS(meta=(
BlueprintSpawnableComponent
))
Position:
Meta
Type:
flag
Adding this means that the component will appear under the "Add" dropdown for adding components to an Actor.
UCLASS(meta=(
BlueprintThreadSafe
))
Position:
Meta
Type:
flag
UCLASS(meta=(
ShowWorldContextPin
))
Position:
Meta
Type:
flag
UCLASS(meta=(
DontUseGenericSpawnObject
=true))
Position:
Meta
Type:
bool
Only used in two places in the engine, on UUserWidget
and DragDropOperation
. TODO is it bool or flag?
UCLASS(Abstract, editinlinenew, BlueprintType, Blueprintable, meta=( DontUseGenericSpawnObject="True", DisableNativeTick) )
class UMG_API UUserWidget : public UWidget, public INamedSlotInterface
UCLASS(meta=(
KismetHideOverrides
="abc"))
Position:
Meta
Type:
string (Comma-separated list)
UCLASS(meta=(KismetHideOverrides="ReceiveAnyDamage,ReceivePointDamage"))
class ENGINE_API ALevelScriptActor : public AActor
UCLASS(meta=(
ExposedAsyncProxy
))
Position:
Meta
Type:
flag
Values in the engine include AsyncTaskRef, AsyncAction, AsyncTask. "The ExposedAsyncProxy metadata specifies the blueprint node will return this object for later canceling."
UCLASS(meta=(
HasDedicatedAsyncNode
))
Position:
Meta
Type:
flag
Related:
If this is present then the editor will not create an async node in the graph.
Config
UCLASS(
Config
="abc")
Position:
Main
Type:
string
UCLASS(
DefaultConfig
)
UCLASS(
PerObjectConfig
)
UCLASS(
ConfigDoNotCheckDefaults
)
UCLASS(
GlobalUserConfig
)
UCLASS(
ProjectUserConfig
)
Editor
UCLASS(
EditInlineNew
)
UCLASS(
NotEditInlineNew
)
UCLASS(
DefaultToInstanced
)
Position:
Main
Type:
flag
Related:
Visibility
UCLASS(
Hidden
)
Position:
Main
Type:
flag
Related:
UCLASS(
HideDropdown
)
Position:
Main
Type:
flag
Related:
UCLASS(
ShowFunctions
="abc")
This makes more sense when you first understand HideFunctions
. I think it works to re-expose functions that were previously hidden using HideFunctions
.
UCLASS(ShowFunctions=FunctionName)
UCLASS(ShowFunctions=(Category1, Category2))
UCLASS(
HideFunctions
="abc")
Say you have a class UCameraComponent
, and within it you define a BlueprintCallable
function SetFieldOfView
. Next, imagine you are creating an orthographic camera class that is a subclass of UCameraComponent
. SetFieldOfView
no loner makes sense in this new child class, so to hide it you add HideFunctions="SetFieldOfView"
to its UCLASS()
.
According to the documentation you can specify either category names or individual functions.
There is only one example of this being used in the engine, interestingly. Ok maybe it's not that interesting.
UCLASS()
class UCameraComponent : public USceneComponent
{
UFUNCTION(BlueprintCallable)
virtual void SetFieldOfView(float InFieldOfView);
};
UCLASS(HideFunctions=(SetFieldOfView))
class UOrthographicCameraComponent : public UCameraComponent
{
// ...
};
UCLASS(
ShowCategories
="abc")
UCLASS(
HideCategories
="abc")
UCLASS(meta=(
ProhibitedInterfaces
="abc"))
Position:
Meta
Type:
string
Not found any examples of this being used in the engine.
UCLASS(meta=(
RestrictedToClasses
="abc"))
Position:
Meta
Type:
string
UCLASS(meta=(RestrictedToClasses="BTNode"))
class AIMODULE_API UBTFunctionLibrary : public UBlueprintFunctionLibrary
Actor
UCLASS(
Placeable
)
Position:
Main
Type:
flag
I'm pretty sure this is on all AActor
subclasses by default. I guess you could specify its opposite NotPlaceable
if you wanted a non-placeable actor. See NotPlaceable
for use cases.
UCLASS(
NotPlaceable
)
"This is used in a lot of places in the engine: on test classes, debug actors, gizmos, actors that should only be spawned by other actors."
UCLASS(
ComponentWrapperClass
)
Position:
Main
Type:
flag
Related:
From what I can tell, this is effectively an alias for IgnoreCategoryKeywordsInSubclasses=true
. A class with this specifier will cause the engine to add the IgnoreCategoryKeywordsInSubclasses
metadata. This in turn causes all subclasses ignore ShowCategories
, HideCategories
, AutoExpandCategories
, AutoCollapseCategories
and PrioritizeCategories
.
Seems to be used on minimal-ish Actors that wrap components. For example on ALight
that wraps ULightComponent
, ASkeletalMeshActor
that wraps USkeletalMeshComponent
.
Co-occurs with ConversionRoot
and ChildCanTick
a lot.
UCLASS(meta=(
ChildCanTick
))
UCLASS(meta=(
ChildCannotTick
))
Serialization
UCLASS(
Transient
)
UCLASS(
NonTransient
)
UCLASS(
Deprecated
)
Position:
Main
Type:
flag
C++
UCLASS(
MinimalAPI
)
Position:
Main
Type:
flag
I find it a bit tricky to understand MinimalAPI. If you have a class that exists in one module and you want to be able to cast to it in another module, I add MinimalAPI.
In ascending order of "how much gets exported" I think of it like this:
- No class specifiers, no
API
macros: nothing exported, the class and its functions are only available within its own module. UCLASS(MinimalAPI)
, noAPI
macros: the class can beCast<T>
to outside of its module, nothing else.MYMODULE_API
on certain functions: only those functions can be called outside of its module.MYMODULE_API
on the class itself: all functions can be called outside of its module.
In general it's good practice to only mark the bare minimum with MYMODULE_API.
// For example we have a class in MyGameplayModule that we want to be able to cast to elsewhere
// Note we do *not* add MYGAMEPLAYMODULE_API
UCLASS(MinimalAPI)
class ASomeGameplayClass : public AActor
UCLASS(
DependsOn
="abc")
Position:
Main
Type:
string (comma-separated)
UCLASS(
Within
="abc")
Position:
Main
Type:
string
This is handy for making it clear that a class is designed to be owned by another. Maybe it uses GetOuter
so it won't work when created within another class. Commonly used with APlayerController
.
UCLASS(Within=PlayerController)
class ENGINE_API UPlayerInput : public UObject
UI
UCLASS(meta=(
DisableNativeTick
))
Position:
Meta
Type:
flag
Only used in one place in the engine, on UUserWidget
.
UCLASS(Abstract, editinlinenew, BlueprintType, Blueprintable, meta=( DontUseGenericSpawnObject="True", DisableNativeTick) )
class UMG_API UUserWidget : public UWidget, public INamedSlotInterface
UCLASS(meta=(
EntryInterface
="abc"))
Position:
Meta
Type:
string (Interface name without leading `I`)
Used to specify the interface that must be implemented by entries to be usable by this list. Only used on UListViewBase
and UListView
.
/**
* A virtualized list that allows up to thousands of items to be displayed.
*
* An important distinction to keep in mind here is "Item" vs. "Entry"
* The list itself is based on a list of n items, but only creates as many entry widgets as can fit on screen.
* For example, a scrolling ListView of 200 items with 5 currently visible will only have created 5 entry widgets.
*
* To make a widget usable as an entry in a ListView, it must inherit from the IUserObjectListEntry interface.
*/
UCLASS(meta = (EntryInterface = UserObjectListEntry))
class UMG_API UListView : public UListViewBase, public ITypedUMGListView<UObject*>
Todo
UCLASS(meta=(
DisplayThumbnail
=true))
Position:
Meta
Type:
bool
Related:
UCLASS(BlueprintType, meta = (DisplayThumbnail = "true"))
class PAPER2D_API UPaperFlipbook : public UObject
UCLASS(
Experimental
)
Position:
Main
Type:
flag
UCLASS(meta=(
IgnoreClassThumbnail
))
Position:
Meta
Type:
flag
UCLASS(meta=(
ExposedAsyncProxy
="abc"))
Position:
Meta
Type:
string (Class name without prefix)
UCLASS(Abstract, meta = (ExposedAsyncProxy = AsyncAction))
class GAMEPLAYABILITIES_API UAbilityAsync : public UBlueprintAsyncActionBase
UCLASS(
ScriptName
="abc")
Position:
Main
Type:
string
UCLASS(MinimalAPI, meta=(ScriptName="ComposureLibrary"))
class UComposureBlueprintLibrary : public UBlueprintFunctionLibrary
UCLASS(meta=(
CommandLineID
="abc"))
Position:
Meta
Type:
string
Only used in the UMovieSceneCapture
class as far as I can tell. For specifying image and movie file formats.
UCLASS(
Optional
)
Position:
Main
Type:
flag
Seems to be used on editor-only data like metadata and comment nodes.
Internal and Deprecated
UCLASS(
Intrinsic
)
Position:
Main
Type:
flag
UCLASS(
NoExport
)
Position:
Main
Type:
flag
UCLASS(
MatchedSerializers
)
Position:
Main
Type:
flag
Seems to be used for very low-level internal classes.
UCLASS(meta=(
UsesHierarchy
))
Position:
Meta
Type:
flag
The official documentation lists this for both UCLASS
and USTRUCT
but there are no instances of it being used in the codebase and no code that seems to recognise it. So I think it's maybe legacy or something someone forgot.
UCLASS(
CustomConstructor
)
Position:
Main
Type:
flag
As of 5.3 has the comment "No longer used in the engine"