Hello,
At around 11:00 Sam kills an enemy and his health percentage doesn’t change.
At around 13:15 Sam kills an enemy and his health percentage drops (indicating that his health/maxhealth has changed from leveling up).
The only change to the code between to the two timestamps is adding GetLevel() inside of Getstat();
This indicates that GetStat is being called somewhere when he levels up.
THE PROBLEM: I am not getting this level up and health changing effect.
I am only calling BaseStats.GetStat() in two other places in code, both in the health script. First reference is in the start function of Health that calls GetStat to set the characters health at the start. The second reference is GetStat providing the experience reward to gain experience.
How is Sam’s character’s health updating when he levels up? In what part of the code does this happen? Also is there a repository to see all of his code at this point in the class? I can see his changes under the video but not a full copy of his code to check this myself.
Thank you,
Michael
P.S. I already made a solution where when an enemy dies and awards experience it also calls a function on the instigator (player) that updates the players health component to have a new max health calling GetStat to do so. I follow along pretty closely but I can not find out where Sam added the code to update the players health so I wanted to compare his solution to my own now.