Download

Different Componentclass for different SubBP

Hi there.

I have 2 Components:
StatComponent
HeroStatComponent.

HeroStatComponent derives from StatComponent. HeroStatComponent has a Level and some additional Variables like Experience, while StatComponent hasn’t them.

I know have 2 other Blueprints:

BasePawn
HeroPawn

BasePawn should use StatComponent, while HeroPawn should use the HeroStatComponent.

I don’t see any possibility to construct an Actor Component and “overwrite” the StatComponent in the HeroPawn BP.

Do I miss something?

Ok So I now got the solution:
The BasePawn doesn’t have a StatComponent (and thus doesn’t get inherited) but has a Variable “Stat Component”.
In the ConstructionScript of BasePawn I use “Add StatComponent” and assign the reference to this Variable.

In the derived Class I add the special Component and assign the reference to the exact same Variable.
This way I can use the same Variable in both Blueprints.