The player health doesn't increase when the player levels up

The player health doesn’t increase when the player levels up, instead the health points are just restored to 50 (which is the max health points for level 1). If the base level is set to level 5 and then the player kills an enemy, the health points will go to 250 (which is the max health points for level 5). Please can I have some help?

Thanks.

It sounds like your OnLevelUp event might be firing before the current level is actually changed.

I’ve looked and onLevelUp doesn’t seem to be firing before the current level is changed
UpdateLevel()
Screenshot 2021-09-07 142620

Hi I have found and solved the bug.
Screenshot 2021-09-07 143434
Screenshot 2021-09-07 143414
Instead of returning the startingLevel I needed the currentLevel.

Good job finding that!
Sometimes bugs aren’t in the first place you’d expect.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.