Download

C++ and Blueprint hierarchies - best practice?

Hey, I’m fairly new to unreal but with long background in C++ programming. I’m trying to wrap my head around how Blueprints and C++ classes can and should be set up.
Is it possible to model this type of hierarchy (the image) in Blueprint / C++?

I would like the BP_MyCharacterBase, BP_MyPlayerCharacter and BP_MyAICharacter to implement common functionality that BP_Vampire, BP_WizardHero, BP_MegaBoss etc can all use.
At the same time I would like the C++ inheritance hierarchy to be able to extend and add functionality in C++ for the AMegaBossAICharacter and AMySpecialPlayerCharacter classes.

In this example BP_MyAICharacter, BP_MyPlayerCharacter, BP_MegaBoss200 and BP_SuperSpecialHero has a weird double inheritance; both from a parent Blueprint and a parent C++ class
Assuming this is not possible, what are some alternatives for sharing “lower level common blueprint code”?

thanks!

No, blueprints can’t support multiple class inheritance of multiple UClass at same time.

You can workaround that with Blueprint Native Events and Blueprint Interfaces.

Thanks Bruno, makes sense.