- Home /
Problem with circular health bars
I've been developing a MMO game within unity for a university project and have been working on it on my laptop. I've had health and mana bars working for quite some time(goes smaller when the stat is lowered, and higher when it is raised), but i recently moved the project onto my PC where i noticed a weird bug.
When I first ran it on my PC the players health and mana variables would decrease but the actual bar would increase in size. So i switched the code from:
renderer.material.SetFloat ("_Cutoff", -(Health));
to:
renderer.material.SetFloat ("_Cutoff", +(Health));
and it worked properly again(On my PC) however when I run the game on my laptop and other machines to test the health bar goes up instead of down.
my health bars are made using this guide; http://answers.unity3d.com/questions/14770/creating-a-circular-progressbar-timer.html
haven't tested this but I think you would need to use ($$anonymous$$axHealth - Health)/$$anonymous$$axHealth
as your cutoff parameter.
Your answer
Follow this Question
Related Questions
My Photon health script doesnt work 2 Answers
Photon Combat script does not work 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers