I want to change variables automatically for my character health and Mana.
I created a new C++ component who hold the health pool, damage reduction and damage function. but inside my parent character class I put the health, damage reduction. because I have more than one archetype.
AMyCharacter::AMyCharacter(){
…
HealthComp = CreateDefaultSubobject(TEXT(“HealthComp”));
HP = 120;
DamageReduction = .15f;
SP = 100;
HealthComp->HealthPool = this->HP;
HealthComp->DamageReduction = this->DamageReduction;
}
but when I start my game, the character only have my default value of HP = 100 and Damage reduction = .10f
I don’t understand why it don’t get the values I gave it. I don’t want to use blueprint because it’s not scalable as C++. and I will have more components that need to get information from the parent class.