Inheritance in mixed (Cpp + BP) Projects

I thought I can work with inheritance in cpp and BP seamlessly. I always start with creating the cpp class first, than in Unreal make a BP from it by choosing it as base class.

Now I have in cpp a BaseClass AEnemyBase and it has a child class ATrainingDummy. I would like to implement common methods in AEnemyBase and use them in ATrainingDummy. In cpp this works. If I add a method to BP_EnemyBase it is not usable in BP_TrainingDummy and the TrainingDummy even seems to not know that it is a child from it. If I use BP_EnemyBase as base class for BP_TrainingDummy it works but than of course it is no longer a cpp TrainingDummy.

Is this simply not possible with Unreal’s reflection system? Did i misunderstood some concept here?

Is this how your Inheritance is setup?

  • AEnemyBase
    • BP_EnemyBase
    • ATrainingDummy
      • BP_TrainingDummy

If it is, functions created in BP_EnemyBase won’t be available in BP_TrainingDummy since BP_TrainingDummy is not a child of BP_EnemyBase.

Yes this is my Setup. Can I make a Child from BP_EnemyBase and still work with it (BP_TrainingDummy) in Cpp?

You can make make BP_TrainingDummy a child of BP_EnemyBase which is a child of AEnemyBase

But you can’t then also have a separate cpp parent class for BP_TrainingDummy like ATrainingDummy. As far as I know, blueprints doesn’t support multiple inheritance.

So, BP_TrainingDummy’s cpp parent will have to be AEnemyBase

*I don’t know if I explained this correctly :sweat_smile:

Thanks a lot :smiley: I think you did explain it correctly! Now that makes things a bit more complicated but I will find a workaorund for it :sweat_smile:

1 Like

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