How to get C++ parent class of blueprinted object at runtime

I’m using GetName() to get the class name of an object during runtime. It’s returning “MyBPName_C”. Ideally I’d like to get the MyClass C++ class name that the blueprint inherits from. Is there a way to do this?

Thanks!

Actually, I just realized I can give all the actor BP’s that inherit from this class the class name as the start of their name. Then select a sub string of the result of GetName(). Would be cool if there’s a less hacky way of doing it…

There is a method for this- in the class.h. So first you have to get the class of the object, then call IsChildOf();

void ARRDevelopCharacter::OnEndOverlap(AActor* Other, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) {

if (Other->GetClass()->IsChildOf(AInteractor::StaticClass())) {

	AInteractor* OldInteractor = Cast<AInteractor>(Other);

	InRangeInteractors.Remove(OldInteractor);