Player leveled up, when it dies and respawns the increased values goes back to default.
The picture below shows that my character has a 1.2 value healthRegen. When my character level ups it gets additional healthRegen, health and mana.
Below is the picture where my character leveled up gaining an additional healthRegen, mana, and health. From 1.2 => 5.92
The picture below shows that my character has been respawned. As you can see the HealthRegen went back to its default value which is 1.2.
I want my character to retain the increased value so when it dies and gets respawned, the healthRegen will remain 5.92.
Any help will be much appreciated! Thanks in Advance!
asked Apr 27 '18 at 09:44 AM in Blueprint Scripting
When you spawn a new actor, its variables are reset, so if you want it to have a different value when spawned, you need to save it somewhere that doesn't get affected by the character spawning, like for instance, the PlayerController. Then, when you spawn the character, you immediately set its health to the value saved in your player controller, or you can simply expose the Character's health OnSpawn and feed it the desired health from your player controller.
If you've got any more questions let me know ;)
answered Apr 27 '18 at 10:10 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here