How can I compare the types between two classes?

I used the IsA function to check if the type of the class I casted is correct. However, I noticed that when using IsA(ParentClass), it returns true even when a derived class(Child Class) is passed. Is there any function available that accurately distinguishes between a parent class and a child class?

I’m sorry for not being fluent in English and thank you in advance.

Simply use direct equality with the classes

// with objects
Child->IsA<AParent>()  //true
Child->GetClass() == AParent::StaticClass()  //false
Child->GetClass() == AChild::StaticClass()  //true

// with classes
ChildClass->IsChildOf<AParent>()  //true
ChildClass == AParent::StaticClass()  //false
ChildClass == AChild::StaticClass()  //true

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.