Skip to main content

Resource

Functions & Variables

How to name functions, variables, parameters, booleans, delegates, and event dispatchers so they match what the engine and other developers expect.

General rules

All identifiers in Unreal Engine use PascalCase. This applies to functions, variables, class names, enums, and namespaces. Underscores appear only in macro names. The b prefix for booleans attaches directly to the capitalized name with no separator: bIsAlive, not b_IsAlive.

Example
Verdict
Why
GetPlayerHealth()GoodPascalCase, verb-noun pattern
get_player_health()BadSnake case, not used in UE
getPlayerHealth()BadcamelCase, not used in UE
PlayerHealthGoodPascalCase variable
playerHealthBadcamelCase is not the UE convention
player_healthBadSnake case is not the UE convention

Functions

Verb-noun pattern

Functions describe actions. Start with a verb, follow with the object being acted on. Omit the object only when it's obvious from context (for example, a UHealthComponent can have GetHealth() instead of GetComponentHealth()).

Verb Prefix
Use For
Example
GetReturn a value without side effectsGetAmmoCount()
SetAssign a valueSetMaxHealth()
Is / Has / CanBoolean queriesIsAlive(), HasAmmo(), CanFire()
FindLookup that may fail (return pointer or optional)FindInventoryItem()
TryOperation that can fail, returns boolTryActivateAbility()
Handle / OnRespond to an event or delegate callback. Epic uses both interchangeably.HandleDamageReceived(), OnHealthChanged()
Init / InitializeOne-time setup logic. Init for short lifecycle names, Initialize for compound names.InitGame(), InitializeComponent()
Begin / EndPaired lifecycle operationsBeginPlay(), EndPlay()
Create / DestroyObject lifecycleCreateWidget(), DestroyComponent()
Apply / RemoveStateful changesApplyDamage(), RemoveStatusEffect()
CalculateDerive a value from inputsCalculateDamage()

Blueprint-specific

Blueprint event graph functions follow the same verb-noun pattern. Custom events use the same naming as delegates they're bound to. Pure functions (const, no side effects) get a green node in Blueprint and don't need a verb prefix when they describe a property.

Variables

Naming pattern

Variables are nouns or noun phrases in PascalCase. They describe what the value _is_, not what it does. Avoid generic names like Data, Info, or Temp unless the scope is genuinely tiny.

Type
Convention
Example
BooleanPrefix with bbIsAlive, bCanFire, bHasAmmo
Integer / FloatDescriptive nounMaxHealth, FireRate, DamageMultiplier
StringDescriptive nounPlayerName, ErrorMessage
PointerNo prefix (UE convention)OwningActor, TargetComponent
ArrayPlural nounActiveEffects, SpawnPoints, CachedResults
MapNounByNoun or NounToNounDamageByType, WidgetsByName
SetPlural nounVisitedNodes, ActiveTags
Timer HandleSuffix with TimerHandleRegenTimerHandle
Soft / Weak PointerSame as pointerWeaponMesh, CharacterClass

Delegates and events

Delegate types

Delegate type names describe the signature, not the instance. The instance name describes the specific event.

Pattern
Convention
Example
Delegate type (C++)F + descriptive PascalCase name. The Delegate/Signature suffix is optional.FOnHealthChanged
Delegate instance (C++)On + PastParticiple/NounOnHealthChanged, OnDeath
Event Dispatcher (BP)On + PastParticiple/NounOnItemPickedUp, OnLevelComplete
Multicast delegateSame as single + use DECLARE_DYNAMIC_MULTICASTOnDamageReceived

Parameters

Function parameters follow the same naming rules as variables. Output parameters use the Out prefix so callers know the function writes to them.

Pattern
Convention
Example
Input parameterSame as variable namingDamageAmount, TargetActor
Output parameterPrefix with OutOutHitResult, OutDamageDealt
const referenceSame as variable, pass by const ref for non-trivial typesconst FVector& Location
Blueprint pin nameSame PascalCase, no abbreviationsDamageType, InstigatorController

Anti-patterns

Abbreviations in namesDmg, Amt
Spell it out: Damage, Amount. Short loop abbreviations like Idx are acceptable since Epic uses them throughout the engine.
Hungarian notation beyond b prefixiCount, fSpeed, strName
UE only uses b for booleans. Type info belongs in the type system, not the name.
Generic namesData, Info, Temp, Result, Manager
Be specific. PlayerHealthData, HitScanResult, InventoryManager.
Redundant type in nameHealthFloat, NameString
The type is already declared. Let the name describe the concept.
Inconsistent verb tense in callbacksOnDamage, OnDied, OnHealthChange
Pick one tense for delegates. OnDamageReceived, OnDeath, OnHealthChanged.

Unreal Directive is free and ad-free.

If it saved you time, you can help keep it that way.

Donate