![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Dragon20C |
I have a sprite that is the hp of my player, I also have a percentage that starts at 100 ( of course), What I want to happen is at 100% I want it to stay its normal white colour but when it reach a low % like 0 or 50 I want it to be red, and making it even redder the lower the number it is!, so my question is how would I convert the percentage so that it fits the modulate 0 to 1 format?
This is what I have:
health_symbol.set_modulate(Color(0.1,0,0))
and this is my health percentage being calculated (just assume it has a variable already attached to it):
(current_health / player_health) * 100)