RealDocs

UKismetMathLibrary::EqualEqual_NameName

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns true if FName A equals FName B. FName comparison is an integer index lookup, making this a very fast O(1) operation regardless of string length.

Caveats & Gotchas

  • FName comparison is case-insensitive by default — `NAME_None == FName("none")` is true. If you need case-sensitive comparison, use FString comparisons instead.
  • NAME_None and an empty FName constructed from an empty string are not the same FName index — `FName() == NAME_None` is true but `FName("") == NAME_None` may not be, depending on engine version. Prefer NAME_None explicitly.

Signature

static UE_INL_API bool EqualEqual_NameName(FName A, FName B)

Parameters

Name Type Description Default
A FName First name to compare.
B FName Second name to compare.

Return Type

bool

Example

Check socket name before attaching C++
FName SocketName = HitResult.BoneName;
if (UKismetMathLibrary::EqualEqual_NameName(SocketName, FName("HeadSocket")))
{
    AttachToHead();
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.