Player Health System (Unreal Engine 5)
As part of a game jam, I created a simple health system.
I began with a simple AnyDamage event. I created a variable for Player Health. Then I made sure to subtract the damage from the Player Health (Which was set at 100). Then for testing purposes, I added a print screen read out that checked if the Player Health was at 0. If it was the Print would read "Dead". Another print out displayed the current Player Health.
Then in the Player blueprint, I ensured that when the game began The health bar is displayed to the viewport so the player can see it in-game.
Finally, I edited the progress bar event graph to ensure it updated as the player health dropped when the J key was pressed.
And the final result in video shows the health bar decrease as J is pressed and the printouts reflect the changes and eventually, character death.
Comments
Post a Comment