{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

FName in Unreal Engine 5 C++UE Docs

FName is Unreal Engine 5's lightweight, immutable, case-insensitive identifier type. You create one from a TEXT() literal, compare it with ==, and convert it to text with ToString().

Blueprint node & C++ equivalent

C++
FName Name = TEXT("Head");
FString AsString = Name.ToString();
bool bEqual = (Name == TEXT("Head"));

What is FName used for?

FName stores hashed string identifiers used for things like bone names, socket names, tags, and asset keys. Construction such as FName Name = TEXT("Head") interns the string into a global table, so subsequent comparisons are fast integer comparisons rather than character-by-character checks. This is why bone and socket lookups in UE5 use FName rather than FString.

Comparing and converting FName

Comparison uses operator==, as in bool bEqual = (Name == TEXT("Head")), and it is case-insensitive by default. To get a human-readable string back, call Name.ToString(), which returns an FString. Because comparison is hash-based, checking two FName values for equality is extremely cheap, making FName ideal for frequently compared identifiers.

FName vs FString vs FText

Use FName for immutable identifiers compared by equality, FString for mutable runtime text you build and manipulate, and FText for localized, user-facing text. FName is not meant for display or text editing; convert it with ToString() only when you need to show or further process it.

Frequently asked questions

How do you create an FName in Unreal Engine 5 C++?+

Assign from a TEXT() literal, for example FName Name = TEXT("Head");. The string is interned into the global name table for fast comparison.

How do you compare two FNames in UE5?+

Use operator==, for example if (Name == TEXT("Head")). The comparison is case-insensitive and very fast because it compares hashed indices.

What is the difference between FName and FString?+

FName is an immutable, hashed identifier optimized for equality comparison, while FString is a mutable string for building and editing text. Convert an FName to text with ToString().

Related Strings, Text & Names nodes

View all Strings, Text & Names nodes →