[Class Inheritance Issue]
Currently I’m facing an issue which is I want the child blueprint class which inherited from the child C++ class still having the access to the parent blueprint functions. Are there any solutions to approach these kind of situation? Thanks you so much.
As far as I know multiple inheritance is not supported by the Unreal Object system. Try moving common functions to a function library or a macro library.
But I feel doing this way could make it more redundant?
Scenario 1: Parent C++ → Parent Blueprint → Child Blueprint (Blueprint Approach)
Pros: -
- Easier to modify by designers via Blueprint Visual Scripting Node.
- Quick prototyping.
Cons: -
- The variables that I want to declare specifically for derived class can only exists at Blueprint, which strictly avoiding me to implement the functions in C++, unless I doing everything in Base C++ class which makes the base class too messy.
Scenario 2: Parent C++ → Child C++ → Blueprint Derived from Child C++ (C++ Approach)
Pros: -
- Exclusive derived class variables that can access from both Child C++ and Blueprint Derived from Child C++.
Cons: -
- Designer can’t edit the base blueprint class, so the designer need to go through all the blueprints class to implement a function which can be called on all the blueprint classes.
So if using function library in these 2 scenarios, using the function library:
Scenario 1: Parent C++ → Parent Blueprint → Child Blueprint (Blueprint Approach)
– Couldn’t edit the Child C++.
Scenario 2: Parent C++ → Child C++ → Blueprint Derived from Child C++ (C++ Approach)
– Didn’t have the base blueprint class, very difficult for designers to tweak the base value.
I was trying to do Parent C++ (Having a Parent Blueprint Reference → Child C++ → Blueprint Derived from Child C++)
, but I think my solution is even stupid. Btw, thank you for your suggestion, maybe I can come up something with the function library or a macro library, really appreciate!