UKismetMathLibrary::EqualEqual_ClassClass
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns true if A and B refer to the exact same UClass (pointer equality). Exposes the == operator on class references to Blueprint.
Caveats & Gotchas
- • This tests exact class identity, not inheritance — `EqualEqual_ClassClass(AEnemy::StaticClass(), AActor::StaticClass())` returns false even though AEnemy inherits AActor. Use ClassIsChildOf for hierarchy checks.
- • In C++, direct pointer comparison (`A == B`) is cheaper and just as correct; this function is primarily a Blueprint convenience.
Signature
static UE_INL_API bool EqualEqual_ClassClass(class UClass* A, class UClass* B) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | class UClass* | First class reference to compare. | — |
| B | class UClass* | Second class reference to compare. | — |
Return Type
bool Example
Check if spawned class matches expected type C++
if (UKismetMathLibrary::EqualEqual_ClassClass(SpawnedActor->GetClass(), AExpectedClass::StaticClass()))
{
// Exact type match
} Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?