x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

alt text

Below is the picture where my character leveled up gaining an additional healthRegen, mana, and health. From 1.2 => 5.92 alt text

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.

alt text

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!

Product Version: UE 4.19
Tags:
more ▼

asked Apr 27 '18 at 09:44 AM in Blueprint Scripting

avatar image

TheSteelJC
39 1 4 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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 ;)

more ▼

answered Apr 27 '18 at 10:10 AM

avatar image

goncasmage
897 12 14 22

avatar image TheSteelJC Apr 27 '18 at 10:29 AM

Thanks for the quick response. I'll try that and let you know if it works.

avatar image TheSteelJC Apr 27 '18 at 11:32 AM

Thanks bro. It's actually working. Cheers.

avatar image goncasmage Apr 27 '18 at 11:38 AM

No problem ;) don't forget to mark the answer as correct

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question