I’ve come across a scenario where I was surprised UE does not have a blueprint node for getting the parent class of a given class. There is a check for “Class is Child Of” which returns a boolean, but I’m hoping to provide a class and get its parent class for the sake of comparing if two different actors share the same parent class (I can’t even accomplish this through casting both to the same parent class and seeing if they’re both valid, because I don’t know what the parent to cast to is, it could be a wide variety of possibilities).
The UClass class inherits from UStruct which is the object which handles the class hierarchy.
UStruct::GetSuperClass() is the function which will give you the parent class, that is, parent UStruct.
Cf Class.h:
UClass* GetSuperClass() const
{
return (UClass*)GetSuperStruct();
}