Question by
tanvas · May 11, 2018 at 07:31 PM ·
javascripthudhealth bar
Healthbar does not work right,Healthbar doesnt work right (JavaScript)
Whenever the player gets damage, the healthbar should be updated and show the current health. But it doesnt matter, how many damage the player recieves, the health bar´s fillAmount always turns to 0. And yes, the script divides the currentHealth trough the maxHealth (100)
var bar : Image;
function healthBar ()
{
bar.fillAmount = currentHealth / maxHealth;
}
Thanks for your answers!
Comment
Your answer
Follow this Question
Related Questions
Sprite behind swipe control 0 Answers
Gaining experience from enemies killed? 1 Answer
convert built in array to javascript error 1 Answer
My while loop seems to crash unity 1 Answer
bullet destroy on collison 1 Answer