You can see on the left side that the damage works. Every time the die rolls, whatever number it lands on is how much health is taken away.
However, on the right side you can see that the health bar shows ‘0/6’ instead of ‘-2/6’ like I want it to, even though the player took 4 damage while only having 2 health left.
I never used resource bars but i think they are not meant for negative values
OR you need to set minimum value to negative if that is possible
One way to do it would be to hide original text of resource bar
I think it had such option
And just place there some text object and now you can display whatever you want
Or if there is action to set minimal value of resource bar you could check if player health is less then 0 if so set bar minimal value to player health
Using a text object almost worked.
It does display the negative values like I wanted, but now it doesn’t show the max health.
So instead of ‘-4/6’, it just shows ‘-4’.
How could I get it to also display the max health?
I considered just making another two text objects, one for the ‘/’ and the other for max health, but I was wondering if there was a way to have it all work with just one text object.
Or smarter thing to do would be to make variable called MaxHP and set it to 6 and now you go with
ToString(Player.Health::Health())+"/"+MaxHP
Or in case above would give error
ToString(Player.Health::Health())+"/"+ToString(MaxHP)
And now if you ever need to increase max health of player you would not need to change anything in text object
Unless your player will never have more than 6 HP then stick to one with “/6”