RealDocs

UObject::IsA

function CoreUObject Since 1.0
#include "UObject/UObjectBaseUtility.h"
Access: public Specifiers: inlineconst

Description

Returns true if this object's class is T or a subclass of T. Uses UE's reflection system rather than C++ RTTI.

Signature

template<class T> bool IsA() const

Return Type

bool

Caveats & Gotchas

  • IsA<T>() is preferred over Cast<T>() != nullptr when you only want a boolean — it avoids the cast overhead.
  • Calling IsA with a null UClass argument triggers a check failure. Ensure the class argument is non-null when using the UClass* overload.
  • Unlike dynamic_cast, IsA will not work correctly for types not registered with the UObject reflection system.

Example

Template form C++
if (MyObject->IsA<ACharacter>())
{
	// MyObject is ACharacter or a subclass
}

Version History

Introduced in: 1.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.