Inheriting Widget Blueprints

I tried flip hazard solution, in 4.1, but things broke very often when modifying the “base” blueprint.

My variant for working around this issue in 4.11 is:

  1. Create a MyWidgetBase_BP that contains all of the logic and absolutely nothing in the designer. No components, no child widgets. Whenever the logic needs to reference a ChildComponent, it calls an empty GetChildComponent() accessor method.

  2. Create a MyWidgetDerived_BP, delete every default in the designer, go to the graph, change parent class to MyWidgetBase_BP.

  3. In each Derived blueprint, fill in the designer stuff, child widgets, etc. Override all the inherited (empty) child component accessor methods to return whatever you put in the designer.

  4. Make sure that no blueprint references components directly, and that all use the (polymorphic) accessor methods.

Voilà! You have now a child class with all the parent class´ logic, ready to override.

Edit:
Try @SuperDuperYeah’s suggestion.

1 Like