Chapter 01

Type System & C++ Conventions

What the class prefixes mean, choosing a base type, what Blueprint can see, and why Unreal inherits the way it does.

In this chapter

  1. Class Name Prefixes
  2. UCLASS vs. USTRUCT — Choosing a Base
  3. Blueprint-Exposable Types
  4. Public Inheritance & Reflection
  5. Small Gotchas
1

Class Name Prefixes

The prefix tells you what a type is, and Unreal Header Tool (UHT) enforces that it matches the actual base type — get it wrong and it won't compile.

PrefixMeaningNotes & examples
UUObject-derived, not an ActorGC-managed and reflected — UActorComponent, UTexture2D
AActor-derivedCan be placed or spawned in a level — AActor, APawn, ACharacter
FPlain struct / non-UObject classNo engine lifecycle — FVector, FString, FStreamableHandle
TTemplateTArray, TMap, TSoftObjectPtr, TSubclassOf
IInterfaceAbstract base you inherit from — IAbilitySystemInterface
EEnumEPrimaryAssetType, EGameFeatureState
SSlate widget (C++ UI)SButton, SWidget
bBoolean variableNot a class prefix — bIsActive, bReplicates
Rule of thumb: U = engine-managed object, A = lives in the world, F = plain data, T = generic container.

2

UCLASS vs. USTRUCT — Choosing a Base

Which base to pick

BasePick it whenCost profile
F structPlain data — no instances or inheritance neededCheapest and cache-friendly; best for large arrays of data
UObjectNeeds GC, reflection, or to be spawned without a world presenceEngine lifecycle overhead, but fully managed
AActorNeeds to exist in the level — transform, spawning, componentsHeaviest; carries the full actor machinery

Ask the questions in order. Does it need to be in the world? Then Actor. Does it need reflection or GC? Then UObject. Otherwise it's data, and a struct is both simpler and faster.


3

Blueprint-Exposable Types

Blueprint supports int32, uint8, bool, float, double, FString, FName and FText.

Notably uint16 and uint32 are not Blueprint-exposable. If a designer needs to see or set the value, it cannot live in one of those types.

4

Public Inheritance & Reflection

Unreal almost always uses public inheritance, because the reflection system, Cast<T>(), and the component model all rely on the "IS-A" relationship.

Private or protected inheritance would break Cast<>, since the base type wouldn't be visible from outside the class. In an engine where casting and reflection are load-bearing, that isn't a stylistic choice — it's a requirement.


5

Small Gotchas

↑ Index Chapter 2 →