RealDocs

FName::FindNumberedName

function Core Since 5.1
#include "UObject/NameTypes.h"
Access: public Specifiers: static

Description

Looks up an already-registered numbered FName without creating a new entry. Returns NAME_None if the combination of base string and number has not yet been added to the name table.

Caveats & Gotchas

  • • Only compiled in when UE_FNAME_OUTLINE_NUMBER is defined (the default since UE 5.1). Call sites must guard with `#if UE_FNAME_OUTLINE_NUMBER` or the code will fail to compile on engine configurations without outline numbers.
  • • This is a lookup-only function — it will never add the name to the table. Use the FName constructor overload that accepts a string and number if you need to guarantee registration.

Signature

CORE_API static FName FindNumberedName(FNameEntryId DisplayId, int32 Number);

Parameters

Name Type Description Default
DisplayId FNameEntryId The display entry ID of the base (unnumbered) name string, obtained from GetDisplayIndex(). —
Number int32 The instance number to look up. —

Return Type

FName

Example

Check whether a numbered name is already registered C++
#if UE_FNAME_OUTLINE_NUMBER
FNameEntryId BaseId = FName(TEXT("MyActor")).GetDisplayIndex();
FName Found = FName::FindNumberedName(BaseId, 3);
if (!Found.IsNone())
{
    // MyActor_3 is already in the name table
    UE_LOG(LogTemp, Log, TEXT("Found: %s"), *Found.ToString());
}
#endif

Version History

Introduced in: 5.1

Version Status Notes
5.6 stable —

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.