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"

For Each Level Up add 10 to maximum HP?

The Title says it all, I'm trying to figure out how to add 10 HP for each level up on the player character. The only complication I'm running into is if the player levels up more than once, I have no idea how to account for that. I'm still pretty new to UE4. Any advice/Help would be nice.

Product Version: UE 4.19
Tags:
more ▼

asked Jun 18 '18 at 07:38 AM in Blueprint Scripting

avatar image

Creampuff6
3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Put this in the character and call it every time you level up:

alt text

Essentially, Get current value of maxHP -> add 10 -> Set maxHP to the new value. Next time you call it, you'll be adding 10 to the already increased value.

capture.png (42.6 kB)
more ▼

answered Jun 18 '18 at 07:45 AM

avatar image

Everynone
15.2k 77 25 62

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hello!

Simply make a custom event onLevelUp , get maxHealth , add ten and set maxHealth.

You can add all the logics you want to this event, like increment maxStrenght, restore health, play animation, open a widget showing new stats and so on.

You can also make an event dispatcher for communicate you leveled up to others blueprints, like level BP and spawn an item as a reward near you for example!

more ▼

answered Jun 18 '18 at 07:56 AM

avatar image

AZTECCO
1k 17 8 15

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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